diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-10-11 07:33:23 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-10-11 07:33:23 +0200 |
commit | 14e616a31fb4f63f48377fd1f4f4abac16555428 (patch) | |
tree | d7d418c1d956156822a402cef7c097fc22936359 /cutl/meta | |
parent | bef8ac3c3489589fa84c7b9d69585fb6fd771c3f (diff) |
Reimplement class_p in a more portable way
Diffstat (limited to 'cutl/meta')
-rw-r--r-- | cutl/meta/class-p.hxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cutl/meta/class-p.hxx b/cutl/meta/class-p.hxx index 79e8469..da1eb89 100644 --- a/cutl/meta/class-p.hxx +++ b/cutl/meta/class-p.hxx @@ -12,14 +12,15 @@ namespace cutl { namespace meta { + // g++ cannot have these inside class_p. + // + template <typename Y> no class_p_test (...); + template <typename Y> yes class_p_test (void (Y::*) ()); + template <typename X> struct class_p { - template <typename Y> static no test (...); - template <typename Y> static yes test (void* Y::*); - - static bool const r = sizeof ( - class_p<X>::template test<X> (0)) == sizeof (yes); + static bool const r = sizeof (class_p_test<X> (0)) == sizeof (yes); }; } } |