From 8e761289a2446367267c6c0d9a26e734f0f78306 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 16 Dec 2020 20:29:05 +0300 Subject: Get rid of legacy build systems and rename cutl/ to libcutl/ --- libcutl/meta/polymorphic-p.hxx | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 libcutl/meta/polymorphic-p.hxx (limited to 'libcutl/meta/polymorphic-p.hxx') diff --git a/libcutl/meta/polymorphic-p.hxx b/libcutl/meta/polymorphic-p.hxx new file mode 100644 index 0000000..13fb531 --- /dev/null +++ b/libcutl/meta/polymorphic-p.hxx @@ -0,0 +1,49 @@ +// file : libcutl/meta/polymorphic-p.hxx +// license : MIT; see accompanying LICENSE file + +#ifndef LIBCUTL_META_POLYMORPHIC_HXX +#define LIBCUTL_META_POLYMORPHIC_HXX + +#include +#include + +namespace cutl +{ + 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 () noexcept; + }; + + static const bool r = sizeof (t1) == sizeof (t2); + }; + + static const bool r = impl::r>::r; + }; + } +} + +#endif // LIBCUTL_META_POLYMORPHIC_HXX -- cgit v1.1