From 6f0d40508286afc8cdd72a0b5f807d5c2a589cfc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Jun 2010 16:33:08 +0200 Subject: Initial implementation --- odb/meta/polymorphic-p.hxx | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 odb/meta/polymorphic-p.hxx (limited to 'odb/meta/polymorphic-p.hxx') diff --git a/odb/meta/polymorphic-p.hxx b/odb/meta/polymorphic-p.hxx new file mode 100644 index 0000000..571ef52 --- /dev/null +++ b/odb/meta/polymorphic-p.hxx @@ -0,0 +1,51 @@ +// file : odb/meta/polymorphic-p.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_META_POLYMORPHIC_HXX +#define ODB_META_POLYMORPHIC_HXX + +#include +#include + +namespace odb +{ + namespace meta + { + template + struct polymorphic_p + { + typedef typename remove_cv::r X; + + template + struct impl + { + static const bool r = false; + }; + + template + struct impl + { + struct t1: Y + { + t1 (); + }; + + struct t2: Y + { + t2 (); + + virtual + ~t2 () throw (); + }; + + static const bool r = sizeof (t1) == sizeof (t2); + }; + + static const bool r = impl::r>::r; + }; + } +} + +#endif // ODB_META_POLYMORPHIC_HXX -- cgit v1.1