2015-04-30 22:43:19 +08:00
|
|
|
// <experimental/map> -*- C++ -*-
|
|
|
|
|
2017-01-01 20:07:43 +08:00
|
|
|
// Copyright (C) 2015-2017 Free Software Foundation, Inc.
|
2015-04-30 22:43:19 +08:00
|
|
|
//
|
|
|
|
// This file is part of the GNU ISO C++ Library. This library is free
|
|
|
|
// software; you can redistribute it and/or modify it under the
|
|
|
|
// terms of the GNU General Public License as published by the
|
|
|
|
// Free Software Foundation; either version 3, or (at your option)
|
|
|
|
// any later version.
|
|
|
|
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
// permissions described in the GCC Runtime Library Exception, version
|
|
|
|
// 3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License and
|
|
|
|
// a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
// <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
/** @file experimental/map
|
|
|
|
* This is a TS C++ Library header.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GLIBCXX_EXPERIMENTAL_MAP
|
|
|
|
#define _GLIBCXX_EXPERIMENTAL_MAP 1
|
|
|
|
|
|
|
|
#pragma GCC system_header
|
|
|
|
|
2017-09-12 22:03:06 +08:00
|
|
|
#if __cplusplus >= 201402L
|
2015-04-30 22:43:19 +08:00
|
|
|
|
|
|
|
#include <map>
|
2015-10-09 19:11:54 +08:00
|
|
|
#include <experimental/bits/erase_if.h>
|
2015-11-13 18:01:05 +08:00
|
|
|
#include <experimental/memory_resource>
|
2015-04-30 22:43:19 +08:00
|
|
|
|
|
|
|
namespace std _GLIBCXX_VISIBILITY(default)
|
|
|
|
{
|
2017-07-23 16:41:35 +08:00
|
|
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|
|
|
|
2015-04-30 22:43:19 +08:00
|
|
|
namespace experimental
|
|
|
|
{
|
|
|
|
inline namespace fundamentals_v2
|
|
|
|
{
|
|
|
|
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc,
|
|
|
|
typename _Predicate>
|
2015-05-01 23:00:46 +08:00
|
|
|
inline void
|
2015-04-30 22:43:19 +08:00
|
|
|
erase_if(map<_Key, _Tp, _Compare, _Alloc>& __cont, _Predicate __pred)
|
|
|
|
{ __detail::__erase_nodes_if(__cont, __pred); }
|
|
|
|
|
|
|
|
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc,
|
|
|
|
typename _Predicate>
|
2015-05-01 23:00:46 +08:00
|
|
|
inline void
|
2015-04-30 22:43:19 +08:00
|
|
|
erase_if(multimap<_Key, _Tp, _Compare, _Alloc>& __cont, _Predicate __pred)
|
|
|
|
{ __detail::__erase_nodes_if(__cont, __pred); }
|
|
|
|
|
2017-07-23 16:41:35 +08:00
|
|
|
namespace pmr {
|
|
|
|
template<typename _Key, typename _Tp, typename _Compare = less<_Key>>
|
|
|
|
using map
|
2015-11-13 18:01:05 +08:00
|
|
|
= std::map<_Key, _Tp, _Compare,
|
|
|
|
polymorphic_allocator<pair<const _Key, _Tp>>>;
|
|
|
|
|
2017-07-23 16:41:35 +08:00
|
|
|
template<typename _Key, typename _Tp, typename _Compare = less<_Key>>
|
|
|
|
using multimap
|
2015-11-13 18:01:05 +08:00
|
|
|
= std::multimap<_Key, _Tp, _Compare,
|
|
|
|
polymorphic_allocator<pair<const _Key, _Tp>>>;
|
2017-07-23 16:41:35 +08:00
|
|
|
} // namespace pmr
|
2015-04-30 22:43:19 +08:00
|
|
|
} // namespace fundamentals_v2
|
|
|
|
} // namespace experimental
|
2017-07-23 16:41:35 +08:00
|
|
|
|
|
|
|
_GLIBCXX_END_NAMESPACE_VERSION
|
2015-04-30 22:43:19 +08:00
|
|
|
} // namespace std
|
|
|
|
|
|
|
|
#endif // C++14
|
|
|
|
|
|
|
|
#endif // _GLIBCXX_EXPERIMENTAL_MAP
|