]> git.lyx.org Git - lyx.git/blob - 3rdparty/boost/boost/parameter/aux_/pack/tag_type.hpp
Update to boost 1.72
[lyx.git] / 3rdparty / boost / boost / parameter / aux_ / pack / tag_type.hpp
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)
5
6 #ifndef BOOST_PARAMETER_AUX_PACK_TAG_TYPE_HPP
7 #define BOOST_PARAMETER_AUX_PACK_TAG_TYPE_HPP
8
9 namespace boost { namespace parameter { namespace aux {
10
11     // helper for tag_type<...>, below.
12     template <typename T>
13     struct get_tag_type0
14     {
15         typedef typename T::key_type type;
16     };
17 }}} // namespace boost::parameter::aux
18
19 #include <boost/parameter/deduced.hpp>
20 #include <boost/parameter/config.hpp>
21
22 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
23 #include <boost/mp11/utility.hpp>
24 #else
25 #include <boost/mpl/eval_if.hpp>
26 #endif
27
28 namespace boost { namespace parameter { namespace aux {
29
30     template <typename T>
31     struct get_tag_type
32 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
33       : ::boost::mp11::mp_if<
34 #else
35       : ::boost::mpl::eval_if<
36 #endif
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>
40         >
41     {
42     };
43 }}} // namespace boost::parameter::aux
44
45 #include <boost/parameter/required.hpp>
46 #include <boost/parameter/optional.hpp>
47
48 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
49 #include <boost/mp11/integral.hpp>
50
51 namespace boost { namespace parameter { namespace aux {
52
53     template <typename T>
54     using tag_type = ::boost::mp11::mp_if<
55         ::boost::mp11::mp_if<
56             ::boost::parameter::aux::is_optional<T>
57           , ::boost::mp11::mp_true
58           , ::boost::parameter::aux::is_required<T>
59         >
60       , ::boost::parameter::aux::get_tag_type<T>
61       , ::boost::mp11::mp_identity<T>
62     >;
63 }}} // namespace boost::parameter::aux
64
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>
69
70 namespace boost { namespace parameter { namespace aux {
71
72     template <typename T>
73     struct tag_type
74       : ::boost::mpl::eval_if<
75             typename ::boost::mpl::if_<
76                 ::boost::parameter::aux::is_optional<T>
77               , ::boost::mpl::true_
78               , ::boost::parameter::aux::is_required<T>
79             >::type
80           , ::boost::parameter::aux::get_tag_type<T>
81           , ::boost::mpl::identity<T>
82         >
83     {
84     };
85 }}} // namespace boost::parameter::aux
86
87 #endif  // BOOST_PARAMETER_CAN_USE_MP11
88 #endif  // include guard
89