Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright Daniel Wallin 2006.
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_AUX_PREPROCESSOR_IMPL_FUNCTION_NAME_HPP
0007 #define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_NAME_HPP
0008 
0009 #define BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_static ()
0010 /**/
0011 
0012 #include <boost/parameter/aux_/preprocessor/is_nullary.hpp>
0013 #include <boost/preprocessor/cat.hpp>
0014 
0015 #define BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name)                      \
0016     BOOST_PARAMETER_IS_NULLARY(                                              \
0017         BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_, name)    \
0018     )
0019 /**/
0020 
0021 #include <boost/preprocessor/seq/seq.hpp>
0022 #include <boost/config.hpp>
0023 
0024 #if defined(BOOST_MSVC)
0025 
0026 // Workaround for MSVC preprocessor.
0027 //
0028 // When stripping static from "static f", msvc will produce " f".  The leading
0029 // whitespace doesn't go away when pasting the token with something else, so
0030 // this thing is a hack to strip the whitespace.
0031 #define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static (
0032 /**/
0033 
0034 #define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name)               \
0035     BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name))
0036 /**/
0037 
0038 #define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name)                   \
0039     BOOST_PP_SEQ_HEAD(                                                       \
0040         BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name)               \
0041     )
0042 /**/
0043 
0044 #else
0045 
0046 #define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static
0047 /**/
0048 
0049 #define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name)                   \
0050     BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name)
0051 /**/
0052 
0053 #endif  // MSVC workarounds needed
0054 
0055 #include <boost/preprocessor/control/expr_if.hpp>
0056 
0057 #define BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name)                         \
0058     BOOST_PP_EXPR_IF(                                                        \
0059         BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name), static              \
0060     )
0061 /**/
0062 
0063 #include <boost/preprocessor/control/if.hpp>
0064 #include <boost/preprocessor/tuple/eat.hpp>
0065 
0066 #define BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name)                           \
0067     BOOST_PP_IF(                                                             \
0068         BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name)                      \
0069       , BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC                         \
0070       , name BOOST_PP_TUPLE_EAT(1)                                           \
0071     )(name)
0072 /**/
0073 
0074 // Produces a name for a parameter specification for the function named base.
0075 #define BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(base, is_const)          \
0076     BOOST_PP_CAT(                                                            \
0077         BOOST_PP_CAT(                                                        \
0078             BOOST_PP_IF(                                                     \
0079                 is_const                                                     \
0080               , boost_param_parameters_const_                                \
0081               , boost_param_parameters_                                      \
0082             )                                                                \
0083           , __LINE__                                                         \
0084         )                                                                    \
0085       , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base)                           \
0086     )
0087 /**/
0088 
0089 // Produces a name for a result type metafunction for the no-spec function
0090 // named base.
0091 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(base, is_const)         \
0092     BOOST_PP_CAT(                                                            \
0093         BOOST_PP_CAT(                                                        \
0094             BOOST_PP_IF(                                                     \
0095                 is_const                                                     \
0096               , boost_param_no_spec_result_const_                            \
0097               , boost_param_no_spec_result_                                  \
0098             )                                                                \
0099           , __LINE__                                                         \
0100         )                                                                    \
0101       , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base)                           \
0102     )
0103 /**/
0104 
0105 // Produces a name for a result type metafunction for the function named base.
0106 #define BOOST_PARAMETER_FUNCTION_RESULT_NAME(base, is_const)                 \
0107     BOOST_PP_CAT(                                                            \
0108         BOOST_PP_CAT(                                                        \
0109             BOOST_PP_IF(                                                     \
0110                 is_const                                                     \
0111               , boost_param_result_const_                                    \
0112               , boost_param_result_                                          \
0113             )                                                                \
0114           , __LINE__                                                         \
0115         )                                                                    \
0116       , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base)                           \
0117     )
0118 /**/
0119 
0120 // Produces a name for the implementation function to which the no-spec
0121 // function named base forwards its result type and argument pack.
0122 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME(base, is_const)           \
0123     BOOST_PP_CAT(                                                            \
0124         BOOST_PP_CAT(                                                        \
0125             BOOST_PP_IF(                                                     \
0126                 is_const                                                     \
0127               , boost_param_no_spec_impl_const                               \
0128               , boost_param_no_spec_impl                                     \
0129             )                                                                \
0130           , __LINE__                                                         \
0131         )                                                                    \
0132       , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base)                           \
0133     )
0134 /**/
0135 
0136 // Can't do boost_param_impl_ ## basee
0137 // because base might start with an underscore.
0138 // daniel: what? how is that relevant? the reason for using CAT()
0139 // is to make sure base is expanded. i'm not sure we need to here,
0140 // but it's more stable to do it.
0141 #define BOOST_PARAMETER_FUNCTION_IMPL_NAME(base, is_const)                   \
0142     BOOST_PP_CAT(                                                            \
0143         BOOST_PP_CAT(                                                        \
0144             BOOST_PP_IF(is_const, boost_param_impl_const, boost_param_impl)  \
0145           , __LINE__                                                         \
0146         )                                                                    \
0147       , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base)                           \
0148     )
0149 /**/
0150 
0151 #endif  // include guard
0152