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

Provide a new traits class remove_const which is identical to the current

RemoveConst (except that the return type is now 'type' instead of 'Type').
If the tr1/type_traits header is present, remove_const will be taken from
there.  If not, remove_const is a copy of the RemoveConst class in this
file.

[[Imported from SVN: r4844]]
parent db7296d2
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#include <dune/common/logictraits.hh> #include <dune/common/logictraits.hh>
#ifdef HAVE_TR1_TYPE_TRAITS
#include <tr1/type_traits>
#endif
namespace Dune namespace Dune
{ {
...@@ -161,6 +165,19 @@ namespace Dune ...@@ -161,6 +165,19 @@ namespace Dune
typedef typename RemoveConstHelper<T, IsVolatile<T>::value>::Type Type; typedef typename RemoveConstHelper<T, IsVolatile<T>::value>::Type Type;
}; };
#ifdef HAVE_TR1_TYPE_TRAITS
using std::tr1::remove_const;
#else
/**
* @brief Removes a const qualifier while preserving others.
*/
template<typename T>
struct remove_const
{
typedef typename RemoveConstHelper<T, IsVolatile<T>::value>::Type type;
};
#endif
/** /**
* @brief Checks wether a type is derived from another. * @brief Checks wether a type is derived from another.
* *
......
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