aboutsummaryrefslogtreecommitdiff
path: root/odb/meta/class-p.hxx
blob: e3d15c969bdafbd31e32badcc4e5c926c0f323dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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