aboutsummaryrefslogtreecommitdiff
path: root/cutl/meta/class-p.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-06 12:52:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-06 12:52:53 +0200
commitcb9ea47e7825b5073d4d645afb94f6326cb7cf4d (patch)
tree201c215b08df918924153a60520046c294438a6b /cutl/meta/class-p.hxx
Start the libcutl repository
Diffstat (limited to 'cutl/meta/class-p.hxx')
-rw-r--r--cutl/meta/class-p.hxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/cutl/meta/class-p.hxx b/cutl/meta/class-p.hxx
new file mode 100644
index 0000000..79e8469
--- /dev/null
+++ b/cutl/meta/class-p.hxx
@@ -0,0 +1,27 @@
+// file : cutl/meta/class-p.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#ifndef CUTL_META_CLASS_HXX
+#define CUTL_META_CLASS_HXX
+
+#include <cutl/meta/answer.hxx>
+
+namespace cutl
+{
+ namespace meta
+ {
+ 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);
+ };
+ }
+}
+
+#endif // CUTL_META_CLASS_HXX