]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/mpl/set/aux_/insert_impl.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
042ca13b2bd81cf24b85bdac5ebf537ba9956a88
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / set / aux_ / insert_impl.hpp
1 \r
2 #ifndef BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED\r
3 #define BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED\r
4 \r
5 // Copyright Aleksey Gurtovoy 2003-2007\r
6 // Copyright David Abrahams 2003-2004\r
7 //\r
8 // Distributed under the Boost Software License, Version 1.0. \r
9 // (See accompanying file LICENSE_1_0.txt or copy at \r
10 // http://www.boost.org/LICENSE_1_0.txt)\r
11 //\r
12 // See http://www.boost.org/libs/mpl for documentation.\r
13 \r
14 // $Id: insert_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $\r
15 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $\r
16 // $Revision: 49267 $\r
17 \r
18 #include <boost/mpl/insert_fwd.hpp>\r
19 #include <boost/mpl/set/aux_/has_key_impl.hpp>\r
20 #include <boost/mpl/set/aux_/item.hpp>\r
21 #include <boost/mpl/set/aux_/tag.hpp>\r
22 #include <boost/mpl/identity.hpp>\r
23 #include <boost/mpl/base.hpp>\r
24 #include <boost/mpl/eval_if.hpp>\r
25 #include <boost/mpl/aux_/na.hpp>\r
26 \r
27 #include <boost/type_traits/is_same.hpp>\r
28 \r
29 namespace boost { namespace mpl {\r
30 \r
31 namespace aux {\r
32 template<  typename Set, typename T > struct set_insert_impl\r
33     : eval_if< \r
34           has_key_impl<aux::set_tag>::apply<Set,T>\r
35         , identity<Set>\r
36         , eval_if< \r
37               is_same< T,typename Set::last_masked_ > \r
38             , base<Set>\r
39             , identity< s_item<T,typename Set::item_> >\r
40             >\r
41         >\r
42 {\r
43 };\r
44 }\r
45 \r
46 template<>\r
47 struct insert_impl< aux::set_tag >\r
48 {\r
49     template< \r
50           typename Set\r
51         , typename PosOrKey\r
52         , typename KeyOrNA\r
53         > \r
54     struct apply\r
55         : aux::set_insert_impl<\r
56               Set\r
57             , typename if_na<KeyOrNA,PosOrKey>::type\r
58             >\r
59     {\r
60     };\r
61 };\r
62 \r
63 }}\r
64 \r
65 #endif // BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED\r