SigUtil  0.95
Utility modules for modern C++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
type_traits.hpp File Reference

Go to the source code of this file.

Classes

struct  sig::impl::is_const< T >
 
struct  sig::impl::identity< T >
 
struct  sig::impl::has_iterator< C >
 
class  sig::impl::has_iterator< C >::Detect_iterator< T >
 

Namespaces

 sig
 
 sig::impl
 

Macros

#define CREATE_MEMBER_DETECTOR(X)
 

Macro Definition Documentation

#define CREATE_MEMBER_DETECTOR (   X)
Value:
template<typename T> class Detect_##X { \
struct Fallback { int X; }; \
struct Derived : T, Fallback { }; \
\
template<typename U, U> struct Check; \
\
typedef char ArrayOfOne[1]; \
typedef char ArrayOfTwo[2]; \
\
template<typename U> static ArrayOfOne & func(Check<int Fallback::*, &U::X> *); \
template<typename U> static ArrayOfTwo & func(...); \
public: \
typedef Detect_##X type; \
enum { value = sizeof(func<Derived>(0)) == 2 }; \
};

Definition at line 20 of file type_traits.hpp.