1 // Copyright David Abrahams, Daniel Wallin 2003.
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)
6 #ifndef BOOST_PARAMETER_AUX_PACK_TAG_TYPE_HPP
7 #define BOOST_PARAMETER_AUX_PACK_TAG_TYPE_HPP
9 namespace boost { namespace parameter { namespace aux {
11 // helper for tag_type<...>, below.
15 typedef typename T::key_type type;
17 }}} // namespace boost::parameter::aux
19 #include <boost/parameter/deduced.hpp>
20 #include <boost/parameter/config.hpp>
22 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
23 #include <boost/mp11/utility.hpp>
25 #include <boost/mpl/eval_if.hpp>
28 namespace boost { namespace parameter { namespace aux {
32 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
33 : ::boost::mp11::mp_if<
35 : ::boost::mpl::eval_if<
37 ::boost::parameter::aux::is_deduced0<T>
38 , ::boost::parameter::aux::get_tag_type0<typename T::key_type>
39 , ::boost::parameter::aux::get_tag_type0<T>
43 }}} // namespace boost::parameter::aux
45 #include <boost/parameter/required.hpp>
46 #include <boost/parameter/optional.hpp>
48 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
49 #include <boost/mp11/integral.hpp>
51 namespace boost { namespace parameter { namespace aux {
54 using tag_type = ::boost::mp11::mp_if<
56 ::boost::parameter::aux::is_optional<T>
57 , ::boost::mp11::mp_true
58 , ::boost::parameter::aux::is_required<T>
60 , ::boost::parameter::aux::get_tag_type<T>
61 , ::boost::mp11::mp_identity<T>
63 }}} // namespace boost::parameter::aux
65 #else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
66 #include <boost/mpl/bool.hpp>
67 #include <boost/mpl/if.hpp>
68 #include <boost/mpl/identity.hpp>
70 namespace boost { namespace parameter { namespace aux {
74 : ::boost::mpl::eval_if<
75 typename ::boost::mpl::if_<
76 ::boost::parameter::aux::is_optional<T>
78 , ::boost::parameter::aux::is_required<T>
80 , ::boost::parameter::aux::get_tag_type<T>
81 , ::boost::mpl::identity<T>
85 }}} // namespace boost::parameter::aux
87 #endif // BOOST_PARAMETER_CAN_USE_MP11
88 #endif // include guard