aboutsummaryrefslogtreecommitdiff
path: root/odb/meta/class-p.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/meta/class-p.hxx')
-rw-r--r--odb/meta/class-p.hxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/odb/meta/class-p.hxx b/odb/meta/class-p.hxx
new file mode 100644
index 0000000..e3d15c9
--- /dev/null
+++ b/odb/meta/class-p.hxx
@@ -0,0 +1,28 @@
+// file : odb/meta/class-p.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_META_CLASS_HXX
+#define ODB_META_CLASS_HXX
+
+#include <odb/meta/answer.hxx>
+
+namespace odb
+{
+ 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
+ {
+ static bool const r = sizeof (class_p_test<X> (0)) == sizeof (yes);
+ };
+ }
+}
+
+#endif // ODB_META_CLASS_HXX