From bada6666c70977a058755ccf232e7d67b24adeed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:21:29 +0200 Subject: New upstream release --- libcutl/cutl/meta/answer.hxx | 24 ++++++++++++++++++ libcutl/cutl/meta/class-p.hxx | 27 ++++++++++++++++++++ libcutl/cutl/meta/polymorphic-p.hxx | 50 +++++++++++++++++++++++++++++++++++++ libcutl/cutl/meta/remove-c.hxx | 26 +++++++++++++++++++ libcutl/cutl/meta/remove-cv.hxx | 23 +++++++++++++++++ libcutl/cutl/meta/remove-p.hxx | 26 +++++++++++++++++++ libcutl/cutl/meta/remove-v.hxx | 26 +++++++++++++++++++ 7 files changed, 202 insertions(+) create mode 100644 libcutl/cutl/meta/answer.hxx create mode 100644 libcutl/cutl/meta/class-p.hxx create mode 100644 libcutl/cutl/meta/polymorphic-p.hxx create mode 100644 libcutl/cutl/meta/remove-c.hxx create mode 100644 libcutl/cutl/meta/remove-cv.hxx create mode 100644 libcutl/cutl/meta/remove-p.hxx create mode 100644 libcutl/cutl/meta/remove-v.hxx (limited to 'libcutl/cutl/meta') diff --git a/libcutl/cutl/meta/answer.hxx b/libcutl/cutl/meta/answer.hxx new file mode 100644 index 0000000..96a3911 --- /dev/null +++ b/libcutl/cutl/meta/answer.hxx @@ -0,0 +1,24 @@ +// file : cutl/meta/answer.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_META_ANSWER_HXX +#define CUTL_META_ANSWER_HXX + +namespace cutl +{ + namespace meta + { + struct yes + { + char filling; + }; + + struct no + { + char filling[2]; + }; + } +} + +#endif // CUTL_META_ANSWER_HXX diff --git a/libcutl/cutl/meta/class-p.hxx b/libcutl/cutl/meta/class-p.hxx new file mode 100644 index 0000000..fec5a59 --- /dev/null +++ b/libcutl/cutl/meta/class-p.hxx @@ -0,0 +1,27 @@ +// file : cutl/meta/class-p.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_META_CLASS_HXX +#define CUTL_META_CLASS_HXX + +#include + +namespace cutl +{ + namespace meta + { + // g++ cannot have these inside class_p. + // + template no class_p_test (...); + template yes class_p_test (void (Y::*) ()); + + template + struct class_p + { + static bool const r = sizeof (class_p_test (0)) == sizeof (yes); + }; + } +} + +#endif // CUTL_META_CLASS_HXX diff --git a/libcutl/cutl/meta/polymorphic-p.hxx b/libcutl/cutl/meta/polymorphic-p.hxx new file mode 100644 index 0000000..dd820db --- /dev/null +++ b/libcutl/cutl/meta/polymorphic-p.hxx @@ -0,0 +1,50 @@ +// file : cutl/meta/polymorphic-p.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_META_POLYMORPHIC_HXX +#define CUTL_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 () throw (); + }; + + static const bool r = sizeof (t1) == sizeof (t2); + }; + + static const bool r = impl::r>::r; + }; + } +} + +#endif // CUTL_META_POLYMORPHIC_HXX diff --git a/libcutl/cutl/meta/remove-c.hxx b/libcutl/cutl/meta/remove-c.hxx new file mode 100644 index 0000000..0f67488 --- /dev/null +++ b/libcutl/cutl/meta/remove-c.hxx @@ -0,0 +1,26 @@ +// file : cutl/meta/remove-c.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_META_REMOVE_C_HXX +#define CUTL_META_REMOVE_C_HXX + +namespace cutl +{ + namespace meta + { + template + struct remove_c + { + typedef X r; + }; + + template + struct remove_c + { + typedef X r; + }; + } +} + +#endif // CUTL_META_REMOVE_C_HXX diff --git a/libcutl/cutl/meta/remove-cv.hxx b/libcutl/cutl/meta/remove-cv.hxx new file mode 100644 index 0000000..1d825da --- /dev/null +++ b/libcutl/cutl/meta/remove-cv.hxx @@ -0,0 +1,23 @@ +// file : cutl/meta/remove-cv.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_META_REMOVE_CV_HXX +#define CUTL_META_REMOVE_CV_HXX + +#include +#include + +namespace cutl +{ + namespace meta + { + template + struct remove_cv + { + typedef typename remove_v::r>::r r; + }; + } +} + +#endif // CUTL_META_REMOVE_CV_HXX diff --git a/libcutl/cutl/meta/remove-p.hxx b/libcutl/cutl/meta/remove-p.hxx new file mode 100644 index 0000000..f032dc2 --- /dev/null +++ b/libcutl/cutl/meta/remove-p.hxx @@ -0,0 +1,26 @@ +// file : cutl/meta/remove-p.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_META_REMOVE_P_HXX +#define CUTL_META_REMOVE_P_HXX + +namespace cutl +{ + namespace meta + { + template + struct remove_p + { + typedef X r; + }; + + template + struct remove_p + { + typedef X r; + }; + } +} + +#endif // CUTL_META_REMOVE_P_HXX diff --git a/libcutl/cutl/meta/remove-v.hxx b/libcutl/cutl/meta/remove-v.hxx new file mode 100644 index 0000000..ac05f28 --- /dev/null +++ b/libcutl/cutl/meta/remove-v.hxx @@ -0,0 +1,26 @@ +// file : cutl/meta/remove-v.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_META_REMOVE_V_HXX +#define CUTL_META_REMOVE_V_HXX + +namespace cutl +{ + namespace meta + { + template + struct remove_v + { + typedef X r; + }; + + template + struct remove_v + { + typedef X r; + }; + } +} + +#endif // CUTL_META_REMOVE_V_HXX -- cgit v1.2.3