libstdc++
|
00001 // <unordered_set> -*- C++ -*- 00002 00003 // Copyright (C) 2007-2019 Free Software Foundation, Inc. 00004 // 00005 // This file is part of the GNU ISO C++ Library. This library is free 00006 // software; you can redistribute it and/or modify it under the 00007 // terms of the GNU General Public License as published by the 00008 // Free Software Foundation; either version 3, or (at your option) 00009 // any later version. 00010 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 00016 // Under Section 7 of GPL version 3, you are granted additional 00017 // permissions described in the GCC Runtime Library Exception, version 00018 // 3.1, as published by the Free Software Foundation. 00019 00020 // You should have received a copy of the GNU General Public License and 00021 // a copy of the GCC Runtime Library Exception along with this program; 00022 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 00023 // <http://www.gnu.org/licenses/>. 00024 00025 /** @file include/unordered_set 00026 * This is a Standard C++ Library header. 00027 */ 00028 00029 #ifndef _GLIBCXX_UNORDERED_SET 00030 #define _GLIBCXX_UNORDERED_SET 1 00031 00032 #pragma GCC system_header 00033 00034 #if __cplusplus < 201103L 00035 # include <bits/c++0x_warning.h> 00036 #else 00037 00038 #include <type_traits> 00039 #include <initializer_list> 00040 #include <bits/allocator.h> 00041 #include <ext/alloc_traits.h> 00042 #include <ext/aligned_buffer.h> 00043 #include <bits/stl_pair.h> 00044 #include <bits/stl_function.h> // equal_to, _Identity, _Select1st 00045 #include <bits/functional_hash.h> 00046 #include <bits/hashtable.h> 00047 #include <bits/unordered_set.h> 00048 #include <bits/range_access.h> 00049 #include <bits/erase_if.h> 00050 00051 #ifdef _GLIBCXX_DEBUG 00052 # include <debug/unordered_set> 00053 #endif 00054 00055 #ifdef _GLIBCXX_PROFILE 00056 # include <profile/unordered_set> 00057 #endif 00058 00059 #if __cplusplus >= 201703L 00060 namespace std _GLIBCXX_VISIBILITY(default) 00061 { 00062 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00063 namespace pmr 00064 { 00065 template<typename _Tp> class polymorphic_allocator; 00066 template<typename _Key, typename _Hash = std::hash<_Key>, 00067 typename _Pred = std::equal_to<_Key>> 00068 using unordered_set 00069 = std::unordered_set<_Key, _Hash, _Pred, 00070 polymorphic_allocator<_Key>>; 00071 template<typename _Key, typename _Hash = std::hash<_Key>, 00072 typename _Pred = std::equal_to<_Key>> 00073 using unordered_multiset 00074 = std::unordered_multiset<_Key, _Hash, _Pred, 00075 polymorphic_allocator<_Key>>; 00076 } // namespace pmr 00077 _GLIBCXX_END_NAMESPACE_VERSION 00078 } // namespace std 00079 #endif // C++17 00080 00081 #if __cplusplus > 201703L 00082 namespace std _GLIBCXX_VISIBILITY(default) 00083 { 00084 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00085 template<typename _Key, typename _Hash, typename _CPred, typename _Alloc, 00086 typename _Predicate> 00087 inline typename unordered_set<_Key, _Hash, _CPred, _Alloc>::size_type 00088 erase_if(unordered_set<_Key, _Hash, _CPred, _Alloc>& __cont, 00089 _Predicate __pred) 00090 { return __detail::__erase_nodes_if(__cont, __pred); } 00091 00092 template<typename _Key, typename _Hash, typename _CPred, typename _Alloc, 00093 typename _Predicate> 00094 inline typename unordered_multiset<_Key, _Hash, _CPred, _Alloc>::size_type 00095 erase_if(unordered_multiset<_Key, _Hash, _CPred, _Alloc>& __cont, 00096 _Predicate __pred) 00097 { return __detail::__erase_nodes_if(__cont, __pred); } 00098 _GLIBCXX_END_NAMESPACE_VERSION 00099 } // namespace std 00100 #endif // C++20 00101 00102 #endif // C++11 00103 00104 #endif // _GLIBCXX_UNORDERED_SET