libstdc++
map
Go to the documentation of this file.
00001 // <map> -*- 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/map
00052  *  This is a Standard C++ Library header.
00053  */
00054 
00055 #ifndef _GLIBCXX_MAP
00056 #define _GLIBCXX_MAP 1
00057 
00058 #pragma GCC system_header
00059 
00060 #include <bits/stl_tree.h>
00061 #include <bits/stl_map.h>
00062 #include <bits/stl_multimap.h>
00063 #include <bits/range_access.h>
00064 #include <bits/erase_if.h>
00065 
00066 #ifdef _GLIBCXX_DEBUG
00067 # include <debug/map>
00068 #endif
00069 
00070 #ifdef _GLIBCXX_PROFILE
00071 # include <profile/map>
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 _Tp, typename _Cmp = std::less<_Key>>
00082       using map
00083         = std::map<_Key, _Tp, _Cmp,
00084                    polymorphic_allocator<pair<const _Key, _Tp>>>;
00085     template<typename _Key, typename _Tp, typename _Cmp = std::less<_Key>>
00086       using multimap
00087         = std::multimap<_Key, _Tp, _Cmp,
00088                         polymorphic_allocator<pair<const _Key, _Tp>>>;
00089   } // namespace pmr
00090 _GLIBCXX_END_NAMESPACE_VERSION
00091 } // namespace std
00092 #endif // C++17
00093 
00094 #if __cplusplus > 201703L
00095 namespace std _GLIBCXX_VISIBILITY(default)
00096 {
00097 _GLIBCXX_BEGIN_NAMESPACE_VERSION
00098   template<typename _Key, typename _Tp, typename _Compare, typename _Alloc,
00099            typename _Predicate>
00100     inline typename map<_Key, _Tp, _Compare, _Alloc>::size_type
00101     erase_if(map<_Key, _Tp, _Compare, _Alloc>& __cont, _Predicate __pred)
00102     { return __detail::__erase_nodes_if(__cont, __pred); }
00103 
00104   template<typename _Key, typename _Tp, typename _Compare, typename _Alloc,
00105            typename _Predicate>
00106     inline typename multimap<_Key, _Tp, _Compare, _Alloc>::size_type
00107     erase_if(multimap<_Key, _Tp, _Compare, _Alloc>& __cont, _Predicate __pred)
00108     { return __detail::__erase_nodes_if(__cont, __pred); }
00109 _GLIBCXX_END_NAMESPACE_VERSION
00110 } // namespace std
00111 #endif // C++20
00112 
00113 #endif /* _GLIBCXX_MAP */