Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:43

0001 
0002 #ifndef BOOST_MPL_MAP_AUX_INSERT_IMPL_HPP_INCLUDED
0003 #define BOOST_MPL_MAP_AUX_INSERT_IMPL_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2003-2004
0006 // Copyright David Abrahams 2003-2004
0007 //
0008 // Distributed under the Boost Software License, Version 1.0. 
0009 // (See accompanying file LICENSE_1_0.txt or copy at 
0010 // http://www.boost.org/LICENSE_1_0.txt)
0011 //
0012 // See http://www.boost.org/libs/mpl for documentation.
0013 
0014 // $Id$
0015 // $Date$
0016 // $Revision$
0017 
0018 #include <boost/mpl/insert_fwd.hpp>
0019 #include <boost/mpl/next_prior.hpp>
0020 #include <boost/mpl/map/aux_/contains_impl.hpp>
0021 #include <boost/mpl/map/aux_/item.hpp>
0022 #include <boost/mpl/map/aux_/tag.hpp>
0023 #include <boost/mpl/aux_/na.hpp>
0024 #include <boost/mpl/aux_/config/typeof.hpp>
0025 
0026 namespace boost { namespace mpl {
0027 
0028 namespace aux {
0029 template< typename Map, typename Pair > 
0030 struct map_insert_impl
0031     : if_< 
0032           contains_impl<aux::map_tag>::apply<Map,Pair>
0033         , Map
0034 #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
0035         , m_item<
0036               typename Pair::first
0037             , typename Pair::second
0038             , Map
0039             >
0040 #else
0041         , m_item<
0042               Map::order::value
0043             , typename Pair::first
0044             , typename Pair::second
0045             , Map
0046             >
0047 #endif
0048         >
0049 {
0050 };
0051 }
0052 
0053 template<>
0054 struct insert_impl< aux::map_tag >
0055 {
0056     template< 
0057           typename Map
0058         , typename PosOrKey
0059         , typename KeyOrNA
0060         > 
0061     struct apply
0062         : aux::map_insert_impl<
0063               Map
0064             , typename if_na<KeyOrNA,PosOrKey>::type
0065             >
0066     {
0067     };
0068 };
0069 
0070 }}
0071 
0072 #endif // BOOST_MPL_MAP_AUX_INSERT_IMPL_HPP_INCLUDED