Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/parameter/aux_/set.hpp @ 47

Last change on this file since 47 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.5 KB
Line 
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
14namespace boost { namespace parameter { namespace aux {
15
16typedef mpl::set0<> set0;
17
18template <class Set, class K>
19struct insert_
20{
21    typedef typename mpl::insert<Set, K>::type type;
22};
23
24template <class Set, class K>
25struct 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
40namespace boost { namespace parameter { namespace aux {
41
42typedef mpl::list0<> set0;
43
44template <class Set, class K>
45struct insert_
46{
47    typedef typename mpl::push_front<Set, K>::type type;
48};
49
50template <class Set, class K>
51struct 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
Note: See TracBrowser for help on using the repository browser.