From 525c773836bd66c482814256b5dfd318d1db66aa Mon Sep 17 00:00:00 2001 From: Sergei Krivonos Date: Sat, 1 Jul 2017 14:55:56 +0300 Subject: [PATCH] adding get_tag definition --- doc/refmanual/get-tag-def.html | 122 +++++++++++++++++++++++++++++++ doc/refmanual/introspection.html | 1 + doc/refmanual/refmanual_toc.html | 1 + include/boost/mpl/get_tag.hpp | 26 +++++++ test/Jamfile.v2 | 1 + test/get_tag_def.cpp | 32 ++++++++ 6 files changed, 183 insertions(+) create mode 100644 doc/refmanual/get-tag-def.html create mode 100644 include/boost/mpl/get_tag.hpp create mode 100644 test/get_tag_def.cpp diff --git a/doc/refmanual/get-tag-def.html b/doc/refmanual/get-tag-def.html new file mode 100644 index 0000000..e92b405 --- /dev/null +++ b/doc/refmanual/get-tag-def.html @@ -0,0 +1,122 @@ + + + + + + +The MPL Reference Manual: BOOST_MPL_GET_TAG_DEF + + + + + +
Front Page / Macros / Introspection / BOOST_MPL_GET_TAG_DEF
+
+

BOOST_MPL_GET_TAG_DEF

+
+

Synopsis

+
+#define BOOST_MPL_GET_TAG_DEF(name) \
+    unspecified token sequence \
+/**/
+
+
+
+

Description

+

Expands into a definition of a lazy getter Metafunction get_tag_name +such that for any type x get_tag_name<x>::type is type where + name is a nested type member of x.

+
+
+

Header

+
+#include <boost/mpl/get_tag.hpp>
+
+
+
+

Parameters

+ +++++ + + + + + + + + + + + + +
ParameterRequirementDescription
nameA legal identifier tokenA name of the member to get.
+
+
+

Expression semantics

+

For any legal C++ identifier name:

+
+BOOST_MPL_GET_TAG_DEF(name)
+
+ +++ + + + + + + + +
Precondition:

Appears at namespace scope.

+
Return type:

None.

+
Semantics:

Equivalent to

+
+namespace boost { namespace mpl {
+
+template<class T>
+struct get_##name {
+	typedef typename T::name type;
+};
+
+}}
+
+
+
+
+

Example

+
+struct test_type_get_tag_def;
+
+BOOST_MPL_GET_TAG_DEF(a_tag);
+
+namespace boost { namespace mpl {
+
+struct test_type_get_tag_def
+{
+	typedef int a_tag;
+};
+
+}}
+
+typedef boost::mpl::get_a_tag<test_type_get_tag_def>::type   got_the_tag;
+
+
+
+ +
+ + + + + diff --git a/doc/refmanual/introspection.html b/doc/refmanual/introspection.html index 174bc96..2623849 100644 --- a/doc/refmanual/introspection.html +++ b/doc/refmanual/introspection.html @@ -19,6 +19,7 @@
  • Introspection