Files

73 lines
1.6 KiB
C++
Raw Permalink Normal View History

2004-09-02 15:41:37 +00:00
#ifndef BOOST_MPL_MAP_AUX_INSERT_IMPL_HPP_INCLUDED
#define BOOST_MPL_MAP_AUX_INSERT_IMPL_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
2008-10-10 09:10:26 +00:00
// $Id$
2004-09-02 15:41:37 +00:00
// $Date$
// $Revision$
#include <boost/mpl/insert_fwd.hpp>
2004-12-14 14:05:33 +00:00
#include <boost/mpl/next_prior.hpp>
2004-09-02 15:41:37 +00:00
#include <boost/mpl/map/aux_/contains_impl.hpp>
#include <boost/mpl/map/aux_/item.hpp>
#include <boost/mpl/map/aux_/tag.hpp>
#include <boost/mpl/aux_/na.hpp>
#include <boost/mpl/aux_/config/typeof.hpp>
namespace boost { namespace mpl {
namespace aux {
2004-09-05 09:45:19 +00:00
template< typename Map, typename Pair >
2004-09-02 15:41:37 +00:00
struct map_insert_impl
: if_<
contains_impl<aux::map_tag>::apply<Map,Pair>
, Map
2004-09-05 09:45:19 +00:00
#if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
2004-09-02 15:41:37 +00:00
, m_item<
typename Pair::first
, typename Pair::second
, Map
>
2004-09-05 09:45:19 +00:00
#else
, m_item<
Map::order::value
2004-09-05 09:45:19 +00:00
, typename Pair::first
, typename Pair::second
, Map
>
#endif
2004-09-02 15:41:37 +00:00
>
{
};
}
template<>
struct insert_impl< aux::map_tag >
{
template<
typename Map
, typename PosOrKey
, typename KeyOrNA
>
struct apply
: aux::map_insert_impl<
Map
, typename if_na<KeyOrNA,PosOrKey>::type
>
{
};
};
}}
#endif // BOOST_MPL_MAP_AUX_INSERT_IMPL_HPP_INCLUDED