Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:43:30

0001 // Copyright Eric Niebler 2005.
0002 // Distributed under the Boost Software License, Version 1.0.
0003 // (See accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_PARAMETER_NESTED_KEYWORD_HPP
0007 #define BOOST_PARAMETER_NESTED_KEYWORD_HPP
0008 
0009 #include <boost/parameter/aux_/name.hpp>
0010 #include <boost/parameter/keyword.hpp>
0011 #include <boost/parameter/config.hpp>
0012 #include <boost/preprocessor/cat.hpp>
0013 #include <boost/preprocessor/stringize.hpp>
0014 
0015 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0016 #define BOOST_PARAMETER_NESTED_KEYWORD_AUX(tag_namespace, q, name, alias)    \
0017     namespace tag_namespace                                                  \
0018     {                                                                        \
0019         template <int Dummy = 0>                                             \
0020         struct BOOST_PP_CAT(name, _)                                         \
0021         {                                                                    \
0022             static BOOST_CONSTEXPR char const* keyword_name()                \
0023             {                                                                \
0024                 return BOOST_PP_STRINGIZE(name);                             \
0025             }                                                                \
0026             using _ = BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(                  \
0027                 BOOST_PP_CAT(name, _)<Dummy>                                 \
0028             );                                                               \
0029             using _1 = BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(                 \
0030                 BOOST_PP_CAT(name, _)<Dummy>                                 \
0031             );                                                               \
0032             BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_BINDING(                    \
0033                 binding_fn                                                   \
0034               , BOOST_PP_CAT(name, _)<Dummy>                                 \
0035             );                                                               \
0036             BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_VALUE(                      \
0037                 fn                                                           \
0038               , BOOST_PP_CAT(name, _)<Dummy>                                 \
0039             );                                                               \
0040             using qualifier = ::boost::parameter::q;                         \
0041             static ::boost::parameter::keyword<                              \
0042                 BOOST_PP_CAT(name, _)<Dummy>                                 \
0043             > const& alias;                                                  \
0044         };                                                                   \
0045         template <int Dummy>                                                 \
0046         ::boost::parameter::keyword<                                         \
0047             BOOST_PP_CAT(name, _)<Dummy>                                     \
0048         > const& BOOST_PP_CAT(name, _)<Dummy>::alias                         \
0049             = ::boost::parameter::keyword<                                   \
0050                 BOOST_PP_CAT(name, _)<Dummy>                                 \
0051             >::instance;                                                     \
0052         typedef BOOST_PP_CAT(name, _)<> name;                                \
0053     }                                                                        \
0054     namespace                                                                \
0055     {                                                                        \
0056         ::boost::parameter::keyword<tag_namespace::name> const& name         \
0057             = ::boost::parameter::keyword<tag_namespace::name>::instance;    \
0058     }
0059 /**/
0060 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0061 #define BOOST_PARAMETER_NESTED_KEYWORD_AUX(tag_namespace, q, name, alias)    \
0062     namespace tag_namespace                                                  \
0063     {                                                                        \
0064         template <int Dummy = 0>                                             \
0065         struct BOOST_PP_CAT(name, _)                                         \
0066         {                                                                    \
0067             static BOOST_CONSTEXPR char const* keyword_name()                \
0068             {                                                                \
0069                 return BOOST_PP_STRINGIZE(name);                             \
0070             }                                                                \
0071             typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(                    \
0072                 BOOST_PP_CAT(name, _)<Dummy>                                 \
0073             ) _;                                                             \
0074             typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(                    \
0075                 BOOST_PP_CAT(name, _)<Dummy>                                 \
0076             ) _1;                                                            \
0077             typedef ::boost::parameter::q qualifier;                         \
0078             static ::boost::parameter::keyword<                              \
0079                 BOOST_PP_CAT(name, _)<Dummy>                                 \
0080             > const& alias;                                                  \
0081         };                                                                   \
0082         template <int Dummy>                                                 \
0083         ::boost::parameter::keyword<                                         \
0084             BOOST_PP_CAT(name, _)<Dummy>                                     \
0085         > const& BOOST_PP_CAT(name, _)<Dummy>::alias                         \
0086             = ::boost::parameter::keyword<                                   \
0087                 BOOST_PP_CAT(name, _)<Dummy>                                 \
0088             >::instance;                                                     \
0089         typedef BOOST_PP_CAT(name, _)<> name;                                \
0090     }                                                                        \
0091     namespace                                                                \
0092     {                                                                        \
0093         ::boost::parameter::keyword<tag_namespace::name> const& name         \
0094             = ::boost::parameter::keyword<tag_namespace::name>::instance;    \
0095     }
0096 /**/
0097 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0098 
0099 #include <boost/parameter/aux_/preprocessor/qualifier.hpp>
0100 
0101 #define BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias)           \
0102     BOOST_PARAMETER_NESTED_KEYWORD_AUX(                                      \
0103         tag_namespace                                                        \
0104       , BOOST_PARAMETER_GET_QUALIFIER(name)                                  \
0105       , BOOST_PARAMETER_UNQUALIFIED(name)                                    \
0106       , alias                                                                \
0107     )
0108 /**/
0109 
0110 #endif  // include guard
0111