File indexing completed on 2025-01-18 09:41:44
0001
0002 #ifndef BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED
0003 #define BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include <boost/mpl/insert_fwd.hpp>
0019 #include <boost/mpl/set/aux_/has_key_impl.hpp>
0020 #include <boost/mpl/set/aux_/item.hpp>
0021 #include <boost/mpl/set/aux_/tag.hpp>
0022 #include <boost/mpl/identity.hpp>
0023 #include <boost/mpl/base.hpp>
0024 #include <boost/mpl/eval_if.hpp>
0025 #include <boost/mpl/aux_/na.hpp>
0026
0027 #include <boost/type_traits/is_same.hpp>
0028
0029 namespace boost { namespace mpl {
0030
0031 namespace aux {
0032 template< typename Set, typename T > struct set_insert_impl
0033 : eval_if<
0034 has_key_impl<aux::set_tag>::apply<Set,T>
0035 , identity<Set>
0036 , eval_if<
0037 is_same< T,typename Set::last_masked_ >
0038 , base<Set>
0039 , identity< s_item<T,typename Set::item_> >
0040 >
0041 >
0042 {
0043 };
0044 }
0045
0046 template<>
0047 struct insert_impl< aux::set_tag >
0048 {
0049 template<
0050 typename Set
0051 , typename PosOrKey
0052 , typename KeyOrNA
0053 >
0054 struct apply
0055 : aux::set_insert_impl<
0056 Set
0057 , typename if_na<KeyOrNA,PosOrKey>::type
0058 >
0059 {
0060 };
0061 };
0062
0063 }}
0064
0065 #endif