1 // Copyright Cromwell D. Enage 2019. 2 // Distributed under the Boost Software License, Version 1.0. 3 // (See accompanying file LICENSE_1_0.txt or copy at 4 // http://www.boost.org/LICENSE_1_0.txt) 5 6 #ifndef BOOST_PARAMETER_PREPROCESSOR_NO_SPEC_HPP 7 #define BOOST_PARAMETER_PREPROCESSOR_NO_SPEC_HPP 8 9 #include <boost/parameter/aux_/preprocessor/impl/function_name.hpp> 10 #include <boost/parameter/aux_/preprocessor/impl/no_spec_overloads.hpp> 11 12 // Exapnds to a variadic function header that is enabled if and only if all 13 // its arguments are tagged arguments. All arguments are accessible via args 14 // and keywords only. 15 #define BOOST_PARAMETER_NO_SPEC_FUNCTION(result, name) \ 16 BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, 0) \ 17 BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_HEAD(name, 0); \ 18 BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD(name, name, 0, 0) \ 19 BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_HEAD(name, 0) 20 /**/ 21 22 #include <boost/preprocessor/control/expr_if.hpp> 23 #include <boost/preprocessor/control/if.hpp> 24 25 // Helper macro for BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION, 26 // BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION, 27 // BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR, and 28 // and BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR. 29 #define BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION_AUX(result, name, impl, c) \ 30 BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, impl, c) \ 31 BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD( \ 32 name \ 33 , impl \ 34 , BOOST_PP_IF(BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(impl), 0, 1) \ 35 , c \ 36 ) \ 37 BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_HEAD(impl, c) \ 38 BOOST_PP_EXPR_IF(c, const) 39 /**/ 40 41 // Exapnds to a variadic member function header that is enabled if and only if 42 // all its arguments are tagged arguments. All arguments are accessible via 43 // args and keywords only. 44 #define BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION(result, name) \ 45 BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION_AUX(result, name, name, 0) 46 /**/ 47 48 // Exapnds to a const-qualified variadic member function header that is 49 // enabled if and only if all its arguments are tagged arguments. All 50 // arguments are accessible via args and keywords only. 51 #define BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION(result, name) \ 52 BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION_AUX(result, name, name, 1) 53 /**/ 54 55 // Exapnds to a variadic function call operator header that is enabled if and 56 // only if all its arguments are tagged arguments. All arguments are 57 // accessible via args and keywords only. 58 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR(result) \ 59 BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION_AUX( \ 60 result, operator(), operator, 0 \ 61 ) 62 /**/ 63 64 // Exapnds to a const-qualified variadic function call operator header that is 65 // enabled if and only if all its arguments are tagged arguments. All 66 // arguments are accessible via args and keywords only. 67 #define BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR(result) \ 68 BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION_AUX( \ 69 result, operator(), operator, 1 \ 70 ) 71 /**/ 72 73 #endif // include guard 74 75