3 #ifndef DUNE_TYPETRAITS_HH
4 #define DUNE_TYPETRAITS_HH
6 #if defined HAVE_TYPE_TRAITS
8 #elif defined HAVE_TR1_TYPE_TRAITS
9 #include <tr1/type_traits>
47 struct PointerTraits {
48 enum { result =
false };
53 struct PointerTraits<U*> {
54 enum { result =
true };
58 template <
class U>
struct ReferenceTraits
60 enum { result =
false };
64 template <
class U>
struct ReferenceTraits<U&>
66 enum { result =
true };
154 template<
typename T,
bool isVolatile>
166 #if defined HAVE_TYPE_TRAITS
167 using std::remove_const;
168 #elif defined HAVE_TR1_TYPE_TRAITS
169 using std::tr1::remove_const;
181 #if defined HAVE_TYPE_TRAITS
182 using std::remove_reference;
183 #elif defined HAVE_TR1_TYPE_TRAITS
184 using std::tr1::remove_reference;
199 # endif // ! defined(DOXYGEN)
211 template<
class From,
class To>
215 struct Big {
char dummy[2];};
216 static Small test(To);
217 static Big test(...);
223 exists =
sizeof(test(makeFrom())) ==
sizeof(Small),
233 template <
class From>
281 template <
class Base,
class Derived>
287 struct Big {
char dummy[2];};
288 static Small test(RawBase*);
289 static Big test(...);
290 static RawDerived* &makePtr ();
294 value =
sizeof(test(makePtr())) ==
sizeof(Small)
306 template<
class T1,
class T2>
318 #ifdef HAVE_TYPE_TRAITS
319 using std::enable_if;
327 template<
bool b,
typename T=
void>
344 template<
class T1,
class T2,
class Type>
346 :
public enable_if<IsInteroperable<T1,T2>::value, Type>
349 #if defined HAVE_TYPE_TRAITS
351 #elif defined HAVE_TR1_TYPE_TRAITS
352 using std::tr1::is_same;
358 template<
typename T1,
typename T2>
386 template<
bool first,
class T1,
class T2>
398 template<
class T1,
class T2>
404 #if DOXYGEN || !HAVE_STD_CONDITIONAL
417 template<
bool first,
class T1,
class T2>
429 template<
class T1,
class T2>
435 #else // DOXYGEN || !HAVE_STD_CONDITIONAL
438 using std::conditional;
440 #endif // DOXYGEN || !HAVE_STD_CONDITIONAL
446 #if HAVE_INTEGRAL_CONSTANT
447 using std::integral_constant;
450 #else // #if HAVE_INTEGRAL_CONSTANT
456 template <
class T, T v>
472 #endif // #else // #if HAVE_INTEGRAL_CONSTANT
503 template<
typename _Tp>
507 template<
typename _Tp>
516 template<
typename _Tp>