2015-07-16 18:12:06 +03:00
|
|
|
#ifndef BOOST_MP11_MAP_HPP_INCLUDED
|
|
|
|
#define BOOST_MP11_MAP_HPP_INCLUDED
|
|
|
|
|
2016-11-17 02:01:50 +02:00
|
|
|
// Copyright 2015, 2016 Peter Dimov.
|
2015-07-16 18:12:06 +03:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2016-11-17 02:01:50 +02:00
|
|
|
#include <boost/mp11/detail/mp_map_find.hpp>
|
2016-11-17 02:51:12 +02:00
|
|
|
#include <boost/mp11/list.hpp>
|
2016-11-17 02:01:50 +02:00
|
|
|
#include <boost/mp11/integral.hpp>
|
2016-11-17 02:51:12 +02:00
|
|
|
#include <boost/mp11/utility.hpp>
|
2016-11-17 02:01:50 +02:00
|
|
|
#include <type_traits>
|
|
|
|
|
2015-07-16 18:12:06 +03:00
|
|
|
namespace boost
|
|
|
|
{
|
|
|
|
|
|
|
|
// mp_map_contains<M, K>
|
2016-11-17 02:01:50 +02:00
|
|
|
template<class M, class K> using mp_map_contains = mp_not<std::is_same<mp_map_find<M, K>, void>>;
|
|
|
|
|
2015-07-16 18:12:06 +03:00
|
|
|
// mp_map_insert<M, T>
|
2016-11-17 02:51:12 +02:00
|
|
|
template<class M, class T> using mp_map_insert = mp_if< mp_map_contains<M, mp_first<T>>, M, mp_push_back<M, T> >;
|
|
|
|
|
2015-07-16 18:12:06 +03:00
|
|
|
// mp_map_replace<M, T>
|
|
|
|
// mp_map_update<M, T, F>
|
2016-11-17 02:01:50 +02:00
|
|
|
// mp_map_erase<M, K>
|
2015-07-16 18:12:06 +03:00
|
|
|
|
|
|
|
} // namespace boost
|
|
|
|
|
|
|
|
#endif // #ifndef BOOST_MP11_MAP_HPP_INCLUDED
|