diff --git a/common/typetraits.hh b/common/typetraits.hh index 43d1e0185aa1857d28e13656194b9248936ef8ba..91d92c3b27fba850fc5d67e2a7fd137fbadc02a0 100644 --- a/common/typetraits.hh +++ b/common/typetraits.hh @@ -141,10 +141,6 @@ namespace Dune }; }; -#ifdef HAVE_TR1_TYPE_TRAITS - using std::tr1::remove_const; -#else - template<typename T, bool isVolatile> struct RemoveConstHelper { @@ -157,6 +153,10 @@ namespace Dune typedef volatile typename ConstantVolatileTraits<T>::UnqualifiedType Type; }; +#ifdef HAVE_TR1_TYPE_TRAITS + using std::tr1::remove_const; +#else + /** * @brief Removes a const qualifier while preserving others. */ @@ -167,6 +167,16 @@ namespace Dune }; #endif + /** + * @brief Removes a const qualifier while preserving others. + * \deprecated Use remove_const instead! + */ + template<typename T> + struct RemoveConst + { + typedef typename RemoveConstHelper<T, IsVolatile<T>::value>::Type Type; + } DUNE_DEPRECATED; + /** * @brief Checks wether a type is derived from another. * @@ -185,7 +195,7 @@ namespace Dune enum { /** @brief True if the conversion exists. */ exists = sizeof(test(makeFrom())) == sizeof(Small), - /** @brief Wether the conversion exists in both ways. */ + /** @brief Whether the conversion exists in both ways. */ isTwoWay = exists && Conversion<To,From>::exists, /** @brief True if To and From are the same type. */ sameType = false @@ -288,6 +298,30 @@ namespace Dune }; #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 + { + enum { + /* @brief Whether T1 is the same type as T2. */ + value=false + }; + } DUNE_DEPRECATED; + + + /** + * @brief Compile time test for testing whether two types are the same. + * \deprecated Use is_same instead! + */ + template<typename T> + struct SameType<T,T> + { + enum { value=true}; + } DUNE_DEPRECATED; + /** * @brief Select a type based on a condition. *