11debfc3dSmrg// <unordered_map> -*- C++ -*- 21debfc3dSmrg 3*8feb0f0bSmrg// Copyright (C) 2007-2020 Free Software Foundation, Inc. 41debfc3dSmrg// 51debfc3dSmrg// This file is part of the GNU ISO C++ Library. This library is free 61debfc3dSmrg// software; you can redistribute it and/or modify it under the 71debfc3dSmrg// terms of the GNU General Public License as published by the 81debfc3dSmrg// Free Software Foundation; either version 3, or (at your option) 91debfc3dSmrg// any later version. 101debfc3dSmrg 111debfc3dSmrg// This library is distributed in the hope that it will be useful, 121debfc3dSmrg// but WITHOUT ANY WARRANTY; without even the implied warranty of 131debfc3dSmrg// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 141debfc3dSmrg// GNU General Public License for more details. 151debfc3dSmrg 161debfc3dSmrg// Under Section 7 of GPL version 3, you are granted additional 171debfc3dSmrg// permissions described in the GCC Runtime Library Exception, version 181debfc3dSmrg// 3.1, as published by the Free Software Foundation. 191debfc3dSmrg 201debfc3dSmrg// You should have received a copy of the GNU General Public License and 211debfc3dSmrg// a copy of the GCC Runtime Library Exception along with this program; 221debfc3dSmrg// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 231debfc3dSmrg// <http://www.gnu.org/licenses/>. 241debfc3dSmrg 251debfc3dSmrg/** @file include/unordered_map 261debfc3dSmrg * This is a Standard C++ Library header. 271debfc3dSmrg */ 281debfc3dSmrg 291debfc3dSmrg#ifndef _GLIBCXX_UNORDERED_MAP 301debfc3dSmrg#define _GLIBCXX_UNORDERED_MAP 1 311debfc3dSmrg 321debfc3dSmrg#pragma GCC system_header 331debfc3dSmrg 341debfc3dSmrg#if __cplusplus < 201103L 351debfc3dSmrg# include <bits/c++0x_warning.h> 361debfc3dSmrg#else 371debfc3dSmrg 381debfc3dSmrg#include <type_traits> 391debfc3dSmrg#include <initializer_list> 401debfc3dSmrg#include <bits/allocator.h> 411debfc3dSmrg#include <ext/alloc_traits.h> 421debfc3dSmrg#include <ext/aligned_buffer.h> 43a2dc1f3fSmrg#include <bits/stl_pair.h> 441debfc3dSmrg#include <bits/stl_function.h> // equal_to, _Identity, _Select1st 451debfc3dSmrg#include <bits/functional_hash.h> 461debfc3dSmrg#include <bits/hashtable.h> 471debfc3dSmrg#include <bits/unordered_map.h> 481debfc3dSmrg#include <bits/range_access.h> 49c0a68be4Smrg#include <bits/erase_if.h> 501debfc3dSmrg 511debfc3dSmrg#ifdef _GLIBCXX_DEBUG 521debfc3dSmrg# include <debug/unordered_map> 531debfc3dSmrg#endif 541debfc3dSmrg 55c0a68be4Smrg#if __cplusplus >= 201703L 56c0a68be4Smrgnamespace std _GLIBCXX_VISIBILITY(default) 57c0a68be4Smrg{ 58c0a68be4Smrg_GLIBCXX_BEGIN_NAMESPACE_VERSION 59c0a68be4Smrg namespace pmr 60c0a68be4Smrg { 61c0a68be4Smrg template<typename _Tp> class polymorphic_allocator; 62c0a68be4Smrg template<typename _Key, typename _Tp, typename _Hash = std::hash<_Key>, 63c0a68be4Smrg typename _Pred = std::equal_to<_Key>> 64c0a68be4Smrg using unordered_map 65c0a68be4Smrg = std::unordered_map<_Key, _Tp, _Hash, _Pred, 66c0a68be4Smrg polymorphic_allocator<pair<const _Key, _Tp>>>; 67c0a68be4Smrg template<typename _Key, typename _Tp, typename _Hash = std::hash<_Key>, 68c0a68be4Smrg typename _Pred = std::equal_to<_Key>> 69c0a68be4Smrg using unordered_multimap 70c0a68be4Smrg = std::unordered_multimap<_Key, _Tp, _Hash, _Pred, 71c0a68be4Smrg polymorphic_allocator<pair<const _Key, _Tp>>>; 72c0a68be4Smrg } // namespace pmr 73c0a68be4Smrg_GLIBCXX_END_NAMESPACE_VERSION 74c0a68be4Smrg} // namespace std 75c0a68be4Smrg#endif // C++17 76c0a68be4Smrg 77c0a68be4Smrg#if __cplusplus > 201703L 78c0a68be4Smrgnamespace std _GLIBCXX_VISIBILITY(default) 79c0a68be4Smrg{ 80c0a68be4Smrg_GLIBCXX_BEGIN_NAMESPACE_VERSION 81c0a68be4Smrg template<typename _Key, typename _Tp, typename _Hash, typename _CPred, 82c0a68be4Smrg typename _Alloc, typename _Predicate> 83c0a68be4Smrg inline typename unordered_map<_Key, _Tp, _Hash, _CPred, _Alloc>::size_type 84c0a68be4Smrg erase_if(unordered_map<_Key, _Tp, _Hash, _CPred, _Alloc>& __cont, 85c0a68be4Smrg _Predicate __pred) 86c0a68be4Smrg { return __detail::__erase_nodes_if(__cont, __pred); } 87c0a68be4Smrg 88c0a68be4Smrg template<typename _Key, typename _Tp, typename _Hash, typename _CPred, 89c0a68be4Smrg typename _Alloc, typename _Predicate> 90c0a68be4Smrg inline typename unordered_multimap<_Key, _Tp, _Hash, _CPred, _Alloc>:: 91c0a68be4Smrg size_type 92c0a68be4Smrg erase_if(unordered_multimap<_Key, _Tp, _Hash, _CPred, _Alloc>& __cont, 93c0a68be4Smrg _Predicate __pred) 94c0a68be4Smrg { return __detail::__erase_nodes_if(__cont, __pred); } 95c0a68be4Smrg_GLIBCXX_END_NAMESPACE_VERSION 96c0a68be4Smrg} // namespace std 97c0a68be4Smrg#endif // C++20 98c0a68be4Smrg 991debfc3dSmrg#endif // C++11 1001debfc3dSmrg 1011debfc3dSmrg#endif // _GLIBCXX_UNORDERED_MAP 102