| 1 |
// file : cutl/meta/class-p.hxx |
| 2 |
// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC |
| 3 |
// license : MIT; see accompanying LICENSE file |
| 4 |
|
| 5 |
#ifndef CUTL_META_CLASS_HXX |
| 6 |
#define CUTL_META_CLASS_HXX |
| 7 |
|
| 8 |
#include <cutl/meta/answer.hxx> |
| 9 |
|
| 10 |
namespace cutl |
| 11 |
{ |
| 12 |
namespace meta |
| 13 |
{ |
| 14 |
// g++ cannot have these inside class_p. |
| 15 |
// |
| 16 |
template <typename Y> no class_p_test (...); |
| 17 |
template <typename Y> yes class_p_test (void (Y::*) ()); |
| 18 |
|
| 19 |
template <typename X> |
| 20 |
struct class_p |
| 21 |
{ |
| 22 |
static bool const r = sizeof (class_p_test<X> (0)) == sizeof (yes); |
| 23 |
}; |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
#endif // CUTL_META_CLASS_HXX |