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