diff --git a/common/typetraits.hh b/common/typetraits.hh index 2bcb6e79f58bf25f9d7e5da1e8f90f6d4c946f3e..9ee52b04d790ffcc696e7770b820cc9f2cc2527a 100644 --- a/common/typetraits.hh +++ b/common/typetraits.hh @@ -276,10 +276,34 @@ namespace Dune : public EnableIf<IsInteroperable<T1,T2>::value, Type> {}; +#ifdef HAVE_TR1_TYPE_TRAITS + using std::tr1::is_same; +#else + /** + * @brief Compile time test for testing whether + * two types are the same. + */ + template<typename T1, typename T2> + struct is_same + { + enum { + /* @brief Whether T1 is the same type as T2. */ + value=false + }; + }; + + + template<typename T> + struct is_same<T,T> + { + enum { value=true}; + }; +#endif /** * @brief Compile time test for testing whether * two types are the same. + * \deprecated Use is_same instead */ template<typename T1, typename T2> struct SameType