Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright Daniel Wallin 2006.
0002 // Copyright Cromwell D. Enage 2017.
0003 // Distributed under the Boost Software License, Version 1.0.
0004 // (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_PARAMETER_PREPROCESSOR_060206_HPP
0008 #define BOOST_PARAMETER_PREPROCESSOR_060206_HPP
0009 
0010 #include <boost/parameter/aux_/preprocessor/impl/forwarding_overloads.hpp>
0011 #include <boost/parameter/aux_/preprocessor/impl/specification.hpp>
0012 #include <boost/preprocessor/cat.hpp>
0013 
0014 // Helper macro for BOOST_PARAMETER_CONSTRUCTOR.
0015 #define BOOST_PARAMETER_CONSTRUCTOR_AUX(class_, base, tag_namespace, args)   \
0016     BOOST_PARAMETER_SPECIFICATION(tag_namespace, ctor, args, 0)              \
0017         BOOST_PP_CAT(constructor_parameters, __LINE__);                      \
0018     BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS(class_, base, args)
0019 /**/
0020 
0021 #include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
0022 
0023 // Defines the implementation function header.
0024 #define BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name, is_const)                   \
0025     template <typename Args>                                                 \
0026     typename BOOST_PARAMETER_FUNCTION_RESULT_NAME(name, is_const)<           \
0027         Args                                                                 \
0028     >::type BOOST_PARAMETER_FUNCTION_IMPL_NAME(name, is_const)(              \
0029         Args const& args                                                     \
0030     )
0031 /**/
0032 
0033 #include <boost/parameter/aux_/preprocessor/impl/parenthesized_return_type.hpp>
0034 #include <boost/parameter/config.hpp>
0035 
0036 // Expands to the result metafunction and the parameters specialization.
0037 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0038 #define BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_ns, args, is_const)  \
0039     template <typename Args>                                                 \
0040     using BOOST_PARAMETER_FUNCTION_RESULT_NAME(name, is_const)               \
0041     = typename BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result);            \
0042     BOOST_PARAMETER_SPECIFICATION(tag_ns, name, args, is_const)              \
0043         BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(name, is_const);
0044 /**/
0045 #else
0046 #define BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_ns, args, is_const)  \
0047     template <typename Args>                                                 \
0048     struct BOOST_PARAMETER_FUNCTION_RESULT_NAME(name, is_const)              \
0049       : BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result)                    \
0050     {                                                                        \
0051     };                                                                       \
0052     BOOST_PARAMETER_SPECIFICATION(tag_ns, name, args, is_const)              \
0053         BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(name, is_const);
0054 /**/
0055 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0056 
0057 // Helper macro for BOOST_PARAMETER_BASIC_FUNCTION.
0058 #define BOOST_PARAMETER_BASIC_FUNCTION_AUX(result, name, tag_ns, args)       \
0059     BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_ns, args, 0)             \
0060     BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name, 0);                             \
0061     BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, name, args, 0, 0)       \
0062     BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name, 0)
0063 /**/
0064 
0065 #include <boost/preprocessor/control/expr_if.hpp>
0066 
0067 // Helper macro for BOOST_PARAMETER_BASIC_MEMBER_FUNCTION,
0068 // BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION,
0069 // BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR, and
0070 // BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR.
0071 #define BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX(r, n, i, tag_ns, args, c)  \
0072     BOOST_PARAMETER_FUNCTION_HEAD(r, i, tag_ns, args, c)                     \
0073     BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(n, i, args, 1, c)             \
0074     BOOST_PARAMETER_FUNCTION_IMPL_HEAD(i, c) BOOST_PP_EXPR_IF(c, const)
0075 /**/
0076 
0077 #include <boost/parameter/aux_/preprocessor/impl/flatten.hpp>
0078 
0079 // Expands to a Boost.Parameter-enabled constructor header.  All arguments are
0080 // accessible via args and keywords only.
0081 #define BOOST_PARAMETER_CONSTRUCTOR(class_, base, tag_namespace, args)       \
0082     BOOST_PARAMETER_CONSTRUCTOR_AUX(                                         \
0083         class_, base, tag_namespace                                          \
0084       , BOOST_PARAMETER_AUX_PP_FLATTEN(2, 2, 3, args)                        \
0085     )
0086 /**/
0087 
0088 // Expands to a Boost.Parameter-enabled function header.  All arguments are
0089 // accessible via args and keywords only.
0090 #define BOOST_PARAMETER_BASIC_FUNCTION(result, name, tag_namespace, args)    \
0091     BOOST_PARAMETER_BASIC_FUNCTION_AUX(                                      \
0092         result, name, tag_namespace                                          \
0093       , BOOST_PARAMETER_AUX_PP_FLATTEN(2, 2, 3, args)                        \
0094     )
0095 /**/
0096 
0097 // Expands to a Boost.Parameter-enabled member function header.  All arguments
0098 // are accessible via args and keywords only.
0099 #define BOOST_PARAMETER_BASIC_MEMBER_FUNCTION(result, name, tag_ns, args)    \
0100     BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX(                               \
0101         result, name, name, tag_ns                                           \
0102       , BOOST_PARAMETER_AUX_PP_FLATTEN(2, 2, 3, args), 0                     \
0103     )
0104 /**/
0105 
0106 // Expands to a Boost.Parameter-enabled const-qualified member function
0107 // header.  All arguments are accessible via args and keywords only.
0108 #define BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION(r, name, tag_ns, args)   \
0109     BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX(                               \
0110         r, name, name, tag_ns                                                \
0111       , BOOST_PARAMETER_AUX_PP_FLATTEN(2, 2, 3, args), 1                     \
0112     )
0113 /**/
0114 
0115 // Expands to a Boost.Parameter-enabled function call operator header.  All
0116 // arguments are accessible via args and keywords only.
0117 #define BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR(result, tag_ns, args)   \
0118     BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX(                               \
0119         result, operator(), operator, tag_ns                                 \
0120       , BOOST_PARAMETER_AUX_PP_FLATTEN(2, 2, 3, args), 0                     \
0121     )
0122 /**/
0123 
0124 // Expands to a Boost.Parameter-enabled const-qualified function call
0125 // operator header.  All arguments are accessible via args and keywords only.
0126 #define BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR(r, tag_ns, args)  \
0127     BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX(                               \
0128         r, operator(), operator, tag_ns                                      \
0129       , BOOST_PARAMETER_AUX_PP_FLATTEN(2, 2, 3, args), 1                     \
0130     )
0131 /**/
0132 
0133 #include <boost/parameter/aux_/preprocessor/impl/function_dispatch_layer.hpp>
0134 
0135 // Helper macro for BOOST_PARAMETER_FUNCTION.
0136 #define BOOST_PARAMETER_FUNCTION_AUX(result, name, tag_ns, args)             \
0137     BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_ns, args, 0)             \
0138     BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name, 0);                             \
0139     BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, name, args, 0, 0)       \
0140     BOOST_PARAMETER_FUNCTION_DISPATCH_LAYER(                                 \
0141         1, (name, BOOST_PARAMETER_FUNCTION_SPLIT_ARGS(args), 0, 0, tag_ns)   \
0142     )
0143 /**/
0144 
0145 // Expands to a Boost.Parameter-enabled function header.  All arguments are
0146 // accessible via args and keywords, as well as by name.
0147 #define BOOST_PARAMETER_FUNCTION(result, name, tag_namespace, args)          \
0148     BOOST_PARAMETER_FUNCTION_AUX(                                            \
0149         result, name, tag_namespace                                          \
0150       , BOOST_PARAMETER_AUX_PP_FLATTEN(3, 2, 3, args)                        \
0151     )
0152 /**/
0153 
0154 #include <boost/preprocessor/control/if.hpp>
0155 
0156 // Helper macro for BOOST_PARAMETER_MEMBER_FUNCTION
0157 // BOOST_PARAMETER_CONST_MEMBER_FUNCTION,
0158 // BOOST_PARAMETER_FUNCTION_CALL_OPERATOR, and
0159 // BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR.
0160 #define BOOST_PARAMETER_MEMBER_FUNCTION_AUX(r, name, impl, tag_ns, c, args)  \
0161     BOOST_PARAMETER_FUNCTION_HEAD(r, impl, tag_ns, args, c)                  \
0162     BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, impl, args, 1, c)       \
0163     BOOST_PARAMETER_FUNCTION_DISPATCH_LAYER(                                 \
0164         0, (                                                                 \
0165             impl                                                             \
0166           , BOOST_PARAMETER_FUNCTION_SPLIT_ARGS(args)                        \
0167           , BOOST_PP_IF(                                                     \
0168                 BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(impl)              \
0169               , 0                                                            \
0170               , 1                                                            \
0171             )                                                                \
0172           , c                                                                \
0173           , tag_ns                                                           \
0174         )                                                                    \
0175     )
0176 /**/
0177 
0178 // Expands to a Boost.Parameter-enabled member function header.  All
0179 // arguments are accessible via args and keywords, as well as by name.
0180 #define BOOST_PARAMETER_MEMBER_FUNCTION(result, name, tag_ns, args)          \
0181     BOOST_PARAMETER_MEMBER_FUNCTION_AUX(                                     \
0182         result, name, name, tag_ns, 0                                        \
0183       , BOOST_PARAMETER_AUX_PP_FLATTEN(3, 2, 3, args)                        \
0184     )
0185 /**/
0186 
0187 // Expands to a Boost.Parameter-enabled const-qualified member function
0188 // header.  All arguments are accessible via args and keywords, as well as
0189 // by name.
0190 #define BOOST_PARAMETER_CONST_MEMBER_FUNCTION(result, name, tag_ns, args)    \
0191     BOOST_PARAMETER_MEMBER_FUNCTION_AUX(                                     \
0192         result, name, name, tag_ns, 1                                        \
0193       , BOOST_PARAMETER_AUX_PP_FLATTEN(3, 2, 3, args)                        \
0194     )
0195 /**/
0196 
0197 // Expands to a Boost.Parameter-enabled function call operator header.  All
0198 // arguments are accessible via args and keywords, as well as by name.
0199 #define BOOST_PARAMETER_FUNCTION_CALL_OPERATOR(result, tag_ns, args)         \
0200     BOOST_PARAMETER_MEMBER_FUNCTION_AUX(                                     \
0201         result, operator(), operator, tag_ns, 0                              \
0202       , BOOST_PARAMETER_AUX_PP_FLATTEN(3, 2, 3, args)                        \
0203     )
0204 /**/
0205 
0206 // Expands to a Boost.Parameter-enabled const-qualified function call operator
0207 // header.  All arguments are accessible via args and keywords, as well as
0208 // by name.
0209 #define BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, args)   \
0210     BOOST_PARAMETER_MEMBER_FUNCTION_AUX(                                     \
0211         result, operator(), operator, tag_ns, 1                              \
0212       , BOOST_PARAMETER_AUX_PP_FLATTEN(3, 2, 3, args)                        \
0213     )
0214 /**/
0215 
0216 #endif  // include guard
0217