1 // Copyright Daniel Wallin 2006.
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_SET_060912_HPP
7 #define BOOST_PARAMETER_SET_060912_HPP
9 #include <boost/parameter/config.hpp>
11 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
12 #include <boost/mp11/list.hpp>
14 namespace boost { namespace parameter { namespace aux {
16 typedef ::boost::mp11::mp_list<> set0;
17 }}} // namespace boost::parameter::aux
19 #include <boost/mp11/algorithm.hpp>
21 namespace boost { namespace parameter { namespace aux {
23 template <typename S, typename K>
26 using type = ::boost::mp11::mp_insert_c<S,0,K>;
28 }}} // namespace boost::parameter::aux
30 #include <boost/mp11/integral.hpp>
31 #include <boost/mp11/utility.hpp>
32 #include <type_traits>
34 namespace boost { namespace parameter { namespace aux {
36 template <typename Set, typename K>
39 using type = ::boost::mp11::mp_if<
40 ::boost::mp11::mp_empty<Set>
41 , ::boost::mp11::mp_false
43 ::boost::mp11::mp_find<Set,K>
44 , ::boost::mp11::mp_size<Set>
48 }}} // namespace boost::parameter::aux
50 #elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
51 #include <boost/mpl/list.hpp>
53 namespace boost { namespace parameter { namespace aux {
55 typedef ::boost::mpl::list0<> set0;
56 }}} // namespace boost::parameter::aux
58 #include <boost/mpl/push_front.hpp>
60 namespace boost { namespace parameter { namespace aux {
62 template <typename Set, typename K>
63 struct insert_ : ::boost::mpl::push_front<Set,K>
66 }}} // namespace boost::parameter::aux
68 #include <boost/mpl/bool.hpp>
69 #include <boost/mpl/if.hpp>
70 #include <boost/mpl/end.hpp>
71 #include <boost/mpl/find.hpp>
72 #include <boost/type_traits/is_same.hpp>
74 namespace boost { namespace parameter { namespace aux {
76 template <typename Set, typename K>
79 typedef typename ::boost::mpl::find<Set,K>::type iter;
80 typedef typename ::boost::mpl::if_<
81 ::boost::is_same<iter,typename ::boost::mpl::end<Set>::type>
82 , ::boost::mpl::false_
86 }}} // namespace boost::parameter::aux
88 #else // !BOOST_PARAMETER_CAN_USE_MP11 && Borland workarounds not needed
89 #include <boost/mpl/set/set0.hpp>
91 namespace boost { namespace parameter { namespace aux {
93 typedef ::boost::mpl::set0<> set0;
94 }}} // namespace boost::parameter::aux
96 #include <boost/mpl/insert.hpp>
98 namespace boost { namespace parameter { namespace aux {
100 template <typename Set, typename K>
101 struct insert_ : ::boost::mpl::insert<Set,K>
104 }}} // namespace boost::parameter::aux
106 #include <boost/mpl/has_key.hpp>
108 namespace boost { namespace parameter { namespace aux {
110 template <typename Set, typename K>
111 struct has_key_ : ::boost::mpl::has_key<Set,K>
114 }}} // namespace boost::parameter::aux
116 #endif // BOOST_PARAMETER_CAN_USE_MP11 || Borland workarounds needed
117 #endif // include guard