File indexing completed on 2025-01-18 09:43:30
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_PARAMETER_NAME_060806_HPP
0008 #define BOOST_PARAMETER_NAME_060806_HPP
0009
0010 #include <boost/parameter/aux_/name.hpp>
0011 #include <boost/preprocessor/stringize.hpp>
0012 #include <boost/config.hpp>
0013
0014 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0015 #define BOOST_PARAMETER_NAME_TAG(tag_namespace, tag, q) \
0016 namespace tag_namespace \
0017 { \
0018 struct tag \
0019 { \
0020 static BOOST_CONSTEXPR char const* keyword_name() \
0021 { \
0022 return BOOST_PP_STRINGIZE(tag); \
0023 } \
0024 using _ = BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(tag); \
0025 using _1 = _; \
0026 BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_BINDING(binding_fn, tag); \
0027 BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_VALUE(fn, tag); \
0028 using qualifier = ::boost::parameter::q; \
0029 }; \
0030 }
0031
0032 #else
0033 #define BOOST_PARAMETER_NAME_TAG(tag_namespace, tag, q) \
0034 namespace tag_namespace \
0035 { \
0036 struct tag \
0037 { \
0038 static BOOST_CONSTEXPR char const* keyword_name() \
0039 { \
0040 return BOOST_PP_STRINGIZE(tag); \
0041 } \
0042 typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(tag) _; \
0043 typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(tag) _1; \
0044 typedef ::boost::parameter::q qualifier; \
0045 }; \
0046 }
0047
0048 #endif
0049
0050 #include <boost/parameter/keyword.hpp>
0051
0052 #define BOOST_PARAMETER_NAME_KEYWORD(tag_namespace, tag, name) \
0053 namespace \
0054 { \
0055 ::boost::parameter::keyword<tag_namespace::tag> const& name \
0056 = ::boost::parameter::keyword<tag_namespace::tag>::instance; \
0057 }
0058
0059
0060 #define BOOST_PARAMETER_BASIC_NAME(tag_namespace, tag, qualifier, name) \
0061 BOOST_PARAMETER_NAME_TAG(tag_namespace, tag, qualifier) \
0062 BOOST_PARAMETER_NAME_KEYWORD(tag_namespace, tag, name)
0063
0064
0065 #define BOOST_PARAMETER_COMPLEX_NAME_TUPLE1(object, namespace) \
0066 (object, namespace), ~
0067
0068
0069 #include <boost/preprocessor/tuple/elem.hpp>
0070
0071 #define BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name) \
0072 BOOST_PP_TUPLE_ELEM(2, 0, (BOOST_PARAMETER_COMPLEX_NAME_TUPLE1 name))
0073
0074
0075 #define BOOST_PARAMETER_COMPLEX_NAME_OBJECT(name) \
0076 BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name))
0077
0078
0079 #define BOOST_PARAMETER_COMPLEX_NAME_NAMESPACE(name) \
0080 BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name))
0081
0082
0083 #include <boost/parameter/aux_/preprocessor/qualifier.hpp>
0084 #include <boost/preprocessor/tuple/eat.hpp>
0085
0086 #define BOOST_PARAMETER_COMPLEX_NAME(name) \
0087 BOOST_PARAMETER_BASIC_NAME( \
0088 BOOST_PARAMETER_COMPLEX_NAME_NAMESPACE(name) \
0089 , BOOST_PARAMETER_UNQUALIFIED(BOOST_PP_TUPLE_EAT(2) name) \
0090 , BOOST_PARAMETER_GET_QUALIFIER(BOOST_PP_TUPLE_EAT(2) name) \
0091 , BOOST_PARAMETER_COMPLEX_NAME_OBJECT(name) \
0092 )
0093
0094
0095 #include <boost/preprocessor/cat.hpp>
0096
0097 #define BOOST_PARAMETER_SIMPLE_NAME(name) \
0098 BOOST_PARAMETER_BASIC_NAME( \
0099 tag \
0100 , BOOST_PARAMETER_UNQUALIFIED(name) \
0101 , BOOST_PARAMETER_GET_QUALIFIER(name) \
0102 , BOOST_PP_CAT(_, BOOST_PARAMETER_UNQUALIFIED(name)) \
0103 )
0104
0105
0106 #include <boost/parameter/aux_/preprocessor/is_binary.hpp>
0107 #include <boost/preprocessor/control/iif.hpp>
0108
0109 #define BOOST_PARAMETER_NAME(name) \
0110 BOOST_PP_IIF( \
0111 BOOST_PARAMETER_IS_BINARY(name) \
0112 , BOOST_PARAMETER_COMPLEX_NAME \
0113 , BOOST_PARAMETER_SIMPLE_NAME \
0114 )(name)
0115
0116
0117 #include <boost/parameter/template_keyword.hpp>
0118
0119 #endif
0120