File indexing completed on 2025-01-18 09:43:31
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_PARAMETER_TEMPLATE_KEYWORD_HPP
0008 #define BOOST_PARAMETER_TEMPLATE_KEYWORD_HPP
0009
0010 #include <boost/parameter/aux_/template_keyword.hpp>
0011 #include <boost/parameter/config.hpp>
0012
0013 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0014 #include <boost/mp11/integral.hpp>
0015 #include <boost/mp11/utility.hpp>
0016 #include <type_traits>
0017 #else
0018 #include <boost/mpl/bool.hpp>
0019 #include <boost/mpl/if.hpp>
0020 #include <boost/mpl/eval_if.hpp>
0021 #include <boost/mpl/identity.hpp>
0022 #include <boost/type_traits/add_lvalue_reference.hpp>
0023 #include <boost/type_traits/is_function.hpp>
0024 #include <boost/type_traits/is_array.hpp>
0025 #endif
0026
0027 namespace boost { namespace parameter {
0028
0029 template <typename Tag, typename T>
0030 struct template_keyword : ::boost::parameter::aux::template_keyword_base
0031 {
0032 typedef Tag key_type;
0033 typedef T value_type;
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0051 using reference = typename ::boost::mp11::mp_eval_if<
0052 ::boost::mp11::mp_if<
0053 ::std::is_function<value_type>
0054 , ::boost::mp11::mp_true
0055 , ::std::is_array<value_type>
0056 >
0057 , ::std::add_lvalue_reference<value_type>
0058 , ::boost::mp11::mp_identity
0059 , value_type
0060 >::type;
0061 #else
0062 typedef typename ::boost::mpl::eval_if<
0063 typename ::boost::mpl::if_<
0064 ::boost::is_function<value_type>
0065 , ::boost::mpl::true_
0066 , ::boost::is_array<value_type>
0067 >::type
0068 , ::boost::add_lvalue_reference<value_type>
0069 , ::boost::mpl::identity<value_type>
0070 >::type reference;
0071 #endif
0072 };
0073 }}
0074
0075 #define BOOST_PARAMETER_TEMPLATE_KEYWORD(name) \
0076 namespace tag \
0077 { \
0078 struct name; \
0079 } \
0080 template <typename T> \
0081 struct name : ::boost::parameter::template_keyword<tag::name,T> \
0082 { \
0083 };
0084
0085
0086 #endif
0087