Skip to content
Snippets Groups Projects
Commit 19b5a715 authored by Oliver Sander's avatar Oliver Sander
Browse files

Put the classes SameType and RemoveConst back in for backward compatibility. ...

Put the classes SameType and RemoveConst back in for backward compatibility.  Marking them as deprecated doesn't work, due to gcc bug 16370

[[Imported from SVN: r4888]]
parent a44d7b4f
No related branches found
No related tags found
No related merge requests found
......@@ -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.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment