libstdc++
|
00001 // <set> -*- C++ -*- 00002 00003 // Copyright (C) 2001-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 /* 00026 * 00027 * Copyright (c) 1994 00028 * Hewlett-Packard Company 00029 * 00030 * Permission to use, copy, modify, distribute and sell this software 00031 * and its documentation for any purpose is hereby granted without fee, 00032 * provided that the above copyright notice appear in all copies and 00033 * that both that copyright notice and this permission notice appear 00034 * in supporting documentation. Hewlett-Packard Company makes no 00035 * representations about the suitability of this software for any 00036 * purpose. It is provided "as is" without express or implied warranty. 00037 * 00038 * 00039 * Copyright (c) 1996,1997 00040 * Silicon Graphics Computer Systems, Inc. 00041 * 00042 * Permission to use, copy, modify, distribute and sell this software 00043 * and its documentation for any purpose is hereby granted without fee, 00044 * provided that the above copyright notice appear in all copies and 00045 * that both that copyright notice and this permission notice appear 00046 * in supporting documentation. Silicon Graphics makes no 00047 * representations about the suitability of this software for any 00048 * purpose. It is provided "as is" without express or implied warranty. 00049 */ 00050 00051 /** @file include/set 00052 * This is a Standard C++ Library header. 00053 */ 00054 00055 #ifndef _GLIBCXX_SET 00056 #define _GLIBCXX_SET 1 00057 00058 #pragma GCC system_header 00059 00060 #include <bits/stl_tree.h> 00061 #include <bits/stl_set.h> 00062 #include <bits/stl_multiset.h> 00063 #include <bits/range_access.h> 00064 #include <bits/erase_if.h> 00065 00066 #ifdef _GLIBCXX_DEBUG 00067 # include <debug/set> 00068 #endif 00069 00070 #ifdef _GLIBCXX_PROFILE 00071 # include <profile/set> 00072 #endif 00073 00074 #if __cplusplus >= 201703L 00075 namespace std _GLIBCXX_VISIBILITY(default) 00076 { 00077 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00078 namespace pmr 00079 { 00080 template<typename _Tp> class polymorphic_allocator; 00081 template<typename _Key, typename _Cmp = std::less<_Key>> 00082 using set = std::set<_Key, _Cmp, polymorphic_allocator<_Key>>; 00083 template<typename _Key, typename _Cmp = std::less<_Key>> 00084 using multiset = std::multiset<_Key, _Cmp, polymorphic_allocator<_Key>>; 00085 } // namespace pmr 00086 _GLIBCXX_END_NAMESPACE_VERSION 00087 } // namespace std 00088 #endif // C++17 00089 00090 #if __cplusplus > 201703L 00091 namespace std _GLIBCXX_VISIBILITY(default) 00092 { 00093 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00094 template<typename _Key, typename _Compare, typename _Alloc, 00095 typename _Predicate> 00096 inline typename set<_Key, _Compare, _Alloc>::size_type 00097 erase_if(set<_Key, _Compare, _Alloc>& __cont, _Predicate __pred) 00098 { return __detail::__erase_nodes_if(__cont, __pred); } 00099 00100 template<typename _Key, typename _Compare, typename _Alloc, 00101 typename _Predicate> 00102 inline typename multiset<_Key, _Compare, _Alloc>::size_type 00103 erase_if(multiset<_Key, _Compare, _Alloc>& __cont, _Predicate __pred) 00104 { return __detail::__erase_nodes_if(__cont, __pred); } 00105 _GLIBCXX_END_NAMESPACE_VERSION 00106 } // namespace std 00107 #endif // C++20 00108 00109 #endif /* _GLIBCXX_SET */