Chris@16
|
1 // Copyright Daniel Wallin 2006. Use, modification and distribution is
|
Chris@16
|
2 // subject to the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
4
|
Chris@16
|
5 #ifndef BOOST_PARAMETER_SET_060912_HPP
|
Chris@16
|
6 # define BOOST_PARAMETER_SET_060912_HPP
|
Chris@16
|
7
|
Chris@16
|
8 # include <boost/detail/workaround.hpp>
|
Chris@16
|
9
|
Chris@16
|
10 # if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
|
Chris@16
|
11 && !BOOST_WORKAROUND(__GNUC__, < 3)
|
Chris@16
|
12 # include <boost/mpl/insert.hpp>
|
Chris@16
|
13 # include <boost/mpl/set/set0.hpp>
|
Chris@16
|
14 # include <boost/mpl/has_key.hpp>
|
Chris@16
|
15
|
Chris@16
|
16 namespace boost { namespace parameter { namespace aux {
|
Chris@16
|
17
|
Chris@16
|
18 typedef mpl::set0<> set0;
|
Chris@16
|
19
|
Chris@16
|
20 template <class Set, class K>
|
Chris@16
|
21 struct insert_
|
Chris@16
|
22 {
|
Chris@16
|
23 typedef typename mpl::insert<Set, K>::type type;
|
Chris@16
|
24 };
|
Chris@16
|
25
|
Chris@16
|
26 template <class Set, class K>
|
Chris@16
|
27 struct has_key_
|
Chris@16
|
28 {
|
Chris@16
|
29 typedef typename mpl::has_key<Set, K>::type type;
|
Chris@16
|
30 };
|
Chris@16
|
31
|
Chris@16
|
32 }}} // namespace boost::parameter::aux
|
Chris@16
|
33
|
Chris@16
|
34 # else
|
Chris@16
|
35
|
Chris@16
|
36 # include <boost/mpl/list.hpp>
|
Chris@16
|
37 # include <boost/mpl/end.hpp>
|
Chris@16
|
38 # include <boost/mpl/find.hpp>
|
Chris@16
|
39 # include <boost/mpl/not.hpp>
|
Chris@16
|
40 # include <boost/mpl/push_front.hpp>
|
Chris@16
|
41
|
Chris@16
|
42 namespace boost { namespace parameter { namespace aux {
|
Chris@16
|
43
|
Chris@16
|
44 typedef mpl::list0<> set0;
|
Chris@16
|
45
|
Chris@16
|
46 template <class Set, class K>
|
Chris@16
|
47 struct insert_
|
Chris@16
|
48 {
|
Chris@16
|
49 typedef typename mpl::push_front<Set, K>::type type;
|
Chris@16
|
50 };
|
Chris@16
|
51
|
Chris@16
|
52 template <class Set, class K>
|
Chris@16
|
53 struct has_key_
|
Chris@16
|
54 {
|
Chris@16
|
55 typedef typename mpl::find<Set, K>::type iter;
|
Chris@16
|
56 typedef mpl::not_<
|
Chris@16
|
57 is_same<iter, typename mpl::end<Set>::type>
|
Chris@16
|
58 > type;
|
Chris@16
|
59 };
|
Chris@16
|
60
|
Chris@16
|
61 }}} // namespace boost::parameter::aux
|
Chris@16
|
62
|
Chris@16
|
63 # endif
|
Chris@16
|
64
|
Chris@16
|
65
|
Chris@16
|
66 #endif // BOOST_PARAMETER_SET_060912_HPP
|
Chris@16
|
67
|