#ifndef BOOST_MP11_MAP_HPP_INCLUDED #define BOOST_MP11_MAP_HPP_INCLUDED // Copyright 2015-2017 Peter Dimov. // // 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 #include #include #include #include #include #include namespace boost { namespace mp11 { // mp_map_contains template using mp_map_contains = mp_not, void>>; // mp_map_insert template using mp_map_insert = mp_if< mp_map_contains>, M, mp_push_back >; // mp_map_replace namespace detail { template struct mp_map_replace_impl; template class M, class... U, class T> struct mp_map_replace_impl, T> { using K = mp_first; // mp_replace_if is inlined here using a struct _f because of msvc-14.0 template struct _f { using type = mp_if< std::is_same, K>, T, V >; }; using type = mp_if< mp_map_contains, K>, M::type...>, M >; }; } // namespace detail template using mp_map_replace = typename detail::mp_map_replace_impl::type; // mp_map_update namespace detail { template class F> struct mp_map_update_impl { template using _f = std::is_same, mp_first>; // _f3> -> L> template using _f3 = mp_assign, mp_rename>>; using type = mp_if< mp_map_contains>, mp_transform_if<_f, _f3, M>, mp_push_back >; }; } // namespace detail template class F> using mp_map_update = typename detail::mp_map_update_impl::type; // mp_map_erase namespace detail { template struct mp_map_erase_impl { template using _f = std::is_same, K>; using type = mp_remove_if; }; } // namespace detail template using mp_map_erase = typename detail::mp_map_erase_impl::type; } // namespace mp11 } // namespace boost #endif // #ifndef BOOST_MP11_MAP_HPP_INCLUDED