gcc/libstdc++-v3/include/debug/unordered_map

1591 lines
46 KiB
Plaintext
Raw Normal View History

re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
// Debugging unordered_map/unordered_multimap implementation -*- C++ -*-
2021-01-04 10:26:59 +01:00
// Copyright (C) 2003-2021 Free Software Foundation, Inc.
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02: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)
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
// 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/>.
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
/** @file debug/unordered_map
* This file is a GNU debug extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_DEBUG_UNORDERED_MAP
#define _GLIBCXX_DEBUG_UNORDERED_MAP 1
#pragma GCC system_header
#if __cplusplus < 201103L
hashtable.h: Fold in include/tr1_impl/hashtable.h contents. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/tr1/hashtable.h: Fold in include/tr1_impl/hashtable.h contents. * include/tr1_impl/hashtable.h: Remove. * include/tr1_impl/hashtable_policy.h: Move and rename... * include/tr1/hashtable_policy.h: ... here. * include/tr1_impl/unordered_map: Move and rename... * include/tr1/unordered_map.h: ... here. * include/tr1_impl/unordered_set: Move and rename... * include/tr1/unordered_set.h: ... here. * include/tr1_impl/unordered_map: Move and rename... * include/tr1/unordered_map.h: ... here. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/std/c++0x_warning.h: Move... * include/bits/c++0x_warning.h: ... here. * include/debug/unordered_map: Adjust. * include/debug/unordered_set: Likewise. * include/std/tuple: Likewise. * include/std/system_error: Likewise. * include/std/forward_list: Likewise. * include/std/thread: Likewise. * include/std/type_traits: Likewise. * include/std/future: Likewise. * include/std/regex: Likewise. * include/std/atomic: Likewise. * include/std/ratio: Likewise. * include/std/random: Likewise. * include/std/unordered_map: Likewise. * include/std/chrono: Likewise.: Likewise. * include/std/condition_variable: Likewise. * include/std/mutex: Likewise. * include/std/unordered_set: Likewise. * include/std/array: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * include/c_global/cinttypes: Likewise. * include/c_global/ctgmath: Likewise. * include/c_global/cfenv: Likewise. * include/c_global/cstdint: Likewise. * include/c_global/cstdbool: Likewise. * include/c_global/ccomplex: Likewise. * include/bits/shared_ptr.h: Do not include <bits/c++0x_warning.h> at all, the file is not meant to be included by the users. * include/bits/functional_hash.h: Likewise. * include/bits/unique_ptr.h: Likewise. * include/bits/forward_list.h: Likewise. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-* line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Likewise. * testsuite/20_util/unique_ptr/assign/assign_neg.cc: Likewise. From-SVN: r156667
2010-02-10 20:14:33 +01:00
# include <bits/c++0x_warning.h>
#else
Forward declare debug containers so std::pmr aliases work Prior to this change, including a <debug/xxx> header when _GLIBCXX_DEBUG is also defined would fail to compile in C++17 or later. The <debug/xxx> header would include the standard <xxx> header which defined std::pmr::xxx as an alias for std::xxx. But in Debug Mode std::xxx refers to std::__debug::xxx which has not been defined yet (because it is in <debug/xxx> after the inclusion of <xxx>). This adds declarations of the debug containers before including the non-Debug Mode <xxx> header, so that the std::pmr::xxx aliases work. * include/debug/deque (std::__debug::deque): Declare. * include/debug/forward_list (std::__debug::forward_list): Declare. * include/debug/list (std::__debug::list): Declare. * include/debug/map (std::__debug::map): Declare. * include/debug/set (std::__debug::set): Declare. * include/debug/unordered_map (std::__debug::unordered_map): Declare. * include/debug/unordered_set (std::__debug::unordered_set): Declare. * include/debug/vector (std::__debug::vector): Declare. * testsuite/23_containers/deque/types/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/forward_list/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/list/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/map/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/multimap/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/multiset/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/set/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc: New test. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adjust dg-error lineno. * testsuite/23_containers/vector/types/pmr_typedefs_debug.cc: New test. From-SVN: r263839
2018-08-24 19:43:18 +02:00
# include <bits/c++config.h>
namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug {
template<typename _Key, typename _Tp, typename _Hash, typename _Pred,
typename _Allocator>
class unordered_map;
template<typename _Key, typename _Tp, typename _Hash, typename _Pred,
typename _Allocator>
class unordered_multimap;
} } // namespace std::__debug
# include <unordered_map>
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
#include <debug/safe_unordered_container.h>
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
#include <debug/safe_container.h>
#include <debug/safe_iterator.h>
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
#include <debug/safe_local_iterator.h>
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
namespace std _GLIBCXX_VISIBILITY(default)
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
{
namespace __debug
{
/// Class std::unordered_map with safety/checking/debug instrumentation.
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
template<typename _Key, typename _Tp,
typename _Hash = std::hash<_Key>,
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
typename _Pred = std::equal_to<_Key>,
typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
class unordered_map
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
: public __gnu_debug::_Safe_container<
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>, _Alloc,
__gnu_debug::_Safe_unordered_container>,
public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
{
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
typedef _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash,
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
_Pred, _Alloc> _Base;
typedef __gnu_debug::_Safe_container<unordered_map,
_Alloc, __gnu_debug::_Safe_unordered_container> _Safe;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_local_iterator
_Base_const_local_iterator;
typedef typename _Base::local_iterator _Base_local_iterator;
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
re PR libstdc++/68222 (_Safe_iterator provides operators the wrapped iterator can't actually support) 2018-08-22 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/68222 * include/debug/safe_iterator.h (_Safe_iterator<_It, _Sq, _Cat>): Add category template parameter. (_Safe_iterator<>::_Const_iterator): Remove. (_Safe_iterator<>::_IsConstant): New. (_Safe_iterator<>::_OtherIterator): New. (_Safe_iterator<_It, _Sq, _Cat>::_Safe_iterator<_MutIte>( const _Safe_iterator<_MutIte, _Sq, _Cat>&)): Add _IsConstant::__value in __gnu_cxx::__enable_if condition. (_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_to): New. (_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_from_begin): New. (_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_to_end): New. (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>): New. (_Safe_iterator<_It, _Sq, _Cat>::operator--()): Move... (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag> ::operator--()): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator--(int)): Move... (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag> ::operator--(int)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::_M_decrementable()): Move... (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag> ::_M_decrementable()): ...here. (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>): New. (_Safe_iterator<_It, _Sq, _Cat>::operator[](const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator[](const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator+=(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator+=(const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator+(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator+(const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator-=(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator-=(const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator-(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator-(const difference_type&)): ...here. (operator<(const _Safe_iterator<>&, const _Safe_iterator<>&)): Constraint to random access iterators. (operator<=(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator>(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator>=(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator-(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator+(const difference_type&, const _Safe_iterator<>&)): Likewise. (__check_dereferenceable(const _Safe_iterator<>&)): Remove. (__get_distance): Remove. (__get_distance_from_begin): Remove. (__get_distance_to_end): Remove. (struct __is_safe_random_iterator<_Safe_iterator<>>): Remove partial specialization. (__base(const _Safe_iterator<>&, std::input_iterator_tag)): Remove. (__base(const _Safe_iterator<>&, std::random_access_iterator_tag)): Remove. (__base(const _Safe_iterator<>&)): Constraint to random access iterator. * include/debug/safe_iterator.tcc (_Safe_iterator<>::_M_get_distance_from_begin()): New. (_Safe_iterator<>::_M_get_distance_to_end()): New. (_Safe_iterator<>::_M_get_distance_to(const _Safe_iterator<>&)): New. (_Safe_iterator<_It, _Seq, std::random_access_iterator_tag> ::_M_valid_range): New. * include/debug/safe_local_iterator.h (_Safe_local_iterator<>::_Const_local_iterator): Remove. (_Safe_local_iterator<>::_IsConstant): New. (_Safe_local_iterator<>::_OtherIterator): New. (_Safe_local_iterator<_It, _Cont>::_Safe_local_iterator<_MutIte, _Cont>( const _Safe_local_iterator<_MutIte, _Seq>&)): Add _IsConstant::__value in __gnu_cxx::__enable_if condition. If singular compare base iterator with _MutIte rather than _It. (_Safe_local_iterator<>::_S_constant): Make constexpr. (_Safe_local_iterator<>::_M_get_distance_to): New. (__check_dereferenceable(const _Safe_local_iterator<>&)): Remove. (__get_distance(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&, std::input_iterator_tag)): Remove. (__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&)): New. * include/debug/safe_local_iterator.tcc (_Safe_local_iterator<>::_M_get_distance_to): New. * include/debug/deque (std::__debug::deque<>): Add ::__gnu_debug::_Safe_iterator<> friend declaration. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise and add ::__gnu_debug::_Safe_local_iterator<> friend declaration. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/formatter.h: Adapt. * include/debug/helper_functions.h (__gnu_debug::_Safe_local_iterator<>): Add declaration. (__get_distance<_Ite>(_Ite, _Ite, std::random_access_iterator_tag): Pass parameter by copy. (__get_distance<_Ite>(_Ite, _Ite, std::input_iterator_tag): Likewise. (__get_distance<_Ite>(_Ite, _Ite): Likewise. (__valid_range_aux<_Integral>): Pass _Integral by copy. (__valid_range<_InputIterator>): Pass _InputIterator by copy. (__valid_range<>(const _Safe_iterator<>&, const _Safe_iterator<>&, typename _Distance_traits<>::__type&)): Declare. (__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&, typename _Distance_traits<>::__type&)): Declare. (__valid_range<>(const _Safe_iterator<>&, const _Safe_iterator<>&)): Declare. (__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&)): Declare. (__can_advance): Adapt. (struct __is_safe_random_iterator<>): Remove. (struct _SIter_base<>): Remove. * include/debug/functions.h: Include <bits/stl_iterator.h>. (__check_dereferenceable): Remove. (__foreign_iterator_aux4, __foreign_iterator_aux3): Adapt. (__foreign_iterator_aux2, __foreign_iterator_aux): Adapt. (__foreign_iterator): Adapt. * include/debug/stl_iterator.h (__is_safe_random_iterator<std::reverse_iterator<>>): Remove. (__base(const std::reverse_iterator<_Safe_iterator<_It, _Sq>)): Constraint for random access iterators. (__niter_base): Adapt. * testsuite/util/testsuite_containers.h: Include <bits/boost_concept_check.h>. (iterator_concept_checks<_It, _Mutable, _Category>): New. (citerator<_Cont>::forward_members::forward_members()): Instantiate latter for container iterator and const_iterator. * testsuite/23_containers/list/68222_neg.cc: New. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adapt line number. * testsuite/23_containers/unordered_set/debug/debug_functions.cc: (test01): Remove. * testsuite/23_containers/vector/debug/debug_functions.cc (test01): Remove. From-SVN: r263786
2018-08-22 20:51:25 +02:00
template<typename _ItT, typename _SeqT, typename _CatT>
friend class ::__gnu_debug::_Safe_iterator;
template<typename _ItT, typename _SeqT>
friend class ::__gnu_debug::_Safe_local_iterator;
libstdc++: Make debug containers prefer copy ctor to base ctor (PR 90102) When given a type which can convert to any container-like type, the C(const C&) copy constructor and C(const C::_Base&) converting constructor are ambiguous. This change replaces the converting constructor's parameter with a reference_wrapper-like type so that calling that constructor requires an additional user-defined conversion. This gives it a lower rank than the copy constructor, avoiding the ambiguity. While testing this change I discovered that __gnu_debug::forward_list doesn't have a convering constructor from the std::forward_list base, so this adds it. We should probably consider whether the converting constructors should be 'explicit' but I'm not changing that now. libstdc++-v3/ChangeLog: PR libstdc++/90102 * include/debug/deque (deque(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/forward_list (forward_list(_Base_ref)): New constructor. * include/debug/list (list(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/map.h (map(const _Base&)): Likewise. * include/debug/multimap.h (multimap(const _Base&)): Likewise. * include/debug/multiset.h (multiset(const _Base&)): Likewise. * include/debug/set.h (set(const _Base&)): Likewise. * include/debug/unordered_map (unordered_map(const _Base&)) (unordered_multimap(const _Base&)): Likewise. * include/debug/unordered_set (unordered_set(const _Base&)) (unordered_multiset(const _Base&)): Likewise. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adjust dg-error line number. * include/debug/vector (vector(const _Base&)): Likewise. * testsuite/23_containers/deque/debug/90102.cc: New test. * testsuite/23_containers/forward_list/debug/90102.cc: New test. * testsuite/23_containers/list/debug/90102.cc: New test. * testsuite/23_containers/map/debug/90102.cc: New test. * testsuite/23_containers/multimap/debug/90102.cc: New test. * testsuite/23_containers/multiset/debug/90102.cc: New test. * testsuite/23_containers/set/debug/90102.cc: New test. * testsuite/23_containers/unordered_map/debug/90102.cc: New test. * testsuite/23_containers/unordered_multimap/debug/90102.cc: New test. * testsuite/23_containers/unordered_multiset/debug/90102.cc: New test. * testsuite/23_containers/unordered_set/debug/90102.cc: New test. * testsuite/23_containers/vector/debug/90102.cc: New test.
2020-06-02 19:13:08 +02:00
// Reference wrapper for base class. See PR libstdc++/90102.
struct _Base_ref
{
_Base_ref(const _Base& __r) : _M_ref(__r) { }
const _Base& _M_ref;
};
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
public:
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
typedef typename _Base::key_type key_type;
typedef typename _Base::value_type value_type;
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
typedef typename _Base::mapped_type mapped_type;
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
typedef typename _Base::pointer pointer;
typedef typename _Base::const_pointer const_pointer;
typedef typename _Base::reference reference;
typedef typename _Base::const_reference const_reference;
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
typedef __gnu_debug::_Safe_iterator<
_Base_iterator, unordered_map> iterator;
typedef __gnu_debug::_Safe_iterator<
_Base_const_iterator, unordered_map> const_iterator;
typedef __gnu_debug::_Safe_local_iterator<
_Base_local_iterator, unordered_map> local_iterator;
typedef __gnu_debug::_Safe_local_iterator<
_Base_const_local_iterator, unordered_map> const_local_iterator;
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
typedef typename _Base::difference_type difference_type;
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
unordered_map() = default;
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
explicit
unordered_map(size_type __n,
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __eql, __a) { }
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
template<typename _InputIterator>
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
unordered_map(_InputIterator __first, _InputIterator __last,
hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. 2010-08-13 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. (operator=(_Hashtable&&)): Define. * include/bits/unordered_map.h (unordered_map(unordered_map&&), unordered_map(const unordered_map&), unordered_multimap (unordered_multimap&&), unordered_multimap(const unordered_multimap&), __unordered_map(__unordered_map&&), __unordered_map(const __unordered_map&), __unordered_multimap(__unordered_multimap&&), __unordered_multimap(const __unordered_multimap&)): Do not define, leave implicit. * include/bits/unordered_set.h (unordered_set(unordered_set&&), unordered_set(const unordered_set&), unordered_multiset (unordered_multiset&&), unordered_multiset(const unordered_multiset&), __unordered_set(__unordered_set&&), __unordered_set(const __unordered_set&), __unordered_multiset(__unordered_multiset&&), __unordered_multiset(const __unordered_multiset&)): Likewise. * include/bits/unordered_map.h (__unordered_map(initializer_list<>), __unordered_map<>::operator=(initializer_list<>), __unordered_multimap(initializer_list<>), __unordered_multimap<>:: operator=(initializer_list<>)): Add. * include/bits/unordered_set.h (__unordered_set(initializer_list<>), __unordered_set<>::operator=(initializer_list<>), __unordered_multiset(initializer_list<>), __unordered_multiset<>:: operator=(initializer_list<>)): Likewise. * include/bits/unordered_map.h (__unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Fix __n default to 0. * include/bits/unordered_set.h (__unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. From-SVN: r163236
2010-08-14 03:00:23 +02:00
size_type __n = 0,
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
const allocator_type& __a = allocator_type())
macros.h (__glibcxx_check_valid_range_at): New. 2018-05-08 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h (__glibcxx_check_valid_range_at): New. * include/debug/functions.h (__check_valid_range): Use latter. * include/debug/macros.h (__glibcxx_check_valid_constructor_range): New, use latter. * include/debug/deque (deque::deque<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter. * include/debug/forward_list (forward_list::forward_list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/list (list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/list (list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/map.h (map::map<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (map::map<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/multimap.h (multimap::multimap<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (multimap::multimap<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/set.h (set::set<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (set::set<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/multiset.h (multiset::multiset<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (multiset::multiset<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/string (basic_string::basic_string<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/unordered_map (unordered_map::unordered_map<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (unordered_multimap::unordered_multimap<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/unordered_set (unordered_set::unordered_set<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (unordered_multiset::unordered_multiset<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/vector (vector::vector<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter. From-SVN: r260053
2018-05-08 21:46:59 +02:00
: _Base(__gnu_debug::__base(
__glibcxx_check_valid_constructor_range(__first, __last)),
[multiple changes] 2010-08-29 Paolo Carlini <paolo.carlini@oracle.com> * testsuite/23_containers/bitset/invalidation: Move... * testsuite/23_containers/bitset/debug/invalidation: ... here. * testsuite/23_containers/deque/invalidation: Move... * testsuite/23_containers/deque/debug/invalidation: ... here. * testsuite/23_containers/list/invalidation: Move... * testsuite/23_containers/list/debug/invalidation: ... here. * testsuite/23_containers/map/invalidation: Move... * testsuite/23_containers/map/debug/invalidation: ... here. * testsuite/23_containers/multimap/invalidation: Move... * testsuite/23_containers/multimap/debug/invalidation: ... here. * testsuite/23_containers/set/invalidation: Move... * testsuite/23_containers/set/debug/invalidation: ... here. * testsuite/23_containers/multiset/invalidation: Move... * testsuite/23_containers/multiset/debug/invalidation: ... here. * testsuite/23_containers/vector/invalidation: Move... * testsuite/23_containers/vector/debug/invalidation: ... here. 2010-08-29 François Dumont <francois.cppdevs@free.fr> * include/bits/stl_algobase.h (_Iter_base): Move... * include/bits/stl_iterator_base_types.h: ...here. * include/debug/functions.h (__check_valid_range, __check_string, __check_sorted): Fix to not depend on _GLIBCXX_DEBUG; include formatter.h and use formatting macros for a consistent debug result. * include/debug/formatter.h (__check_singular): Declare; do not include debug.h. * include/debug/debug.h: Do not include formatter.h. * include/debug/safe_iterator.h (_Safe_iterator::_Base_Iterator) rename to iterator_type. (__gnu_debug::__base): Add. * include/debug/set.h: Use everywhere __gnu_debug::__base once iterator range valided. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * testsuite/23_containers/util/debug/assign_neg.h: New test cases on debug checks performed on container assign operation. * testsuite/23_containers/util/debug/construct_neg.h: New test cases on debug checks on constructors. * testsuite/23_containers/util/debug/insert_neg.h: New test cases on debug checks performed on container insert operations. * testsuite/23_containers/unordered_map/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: New. * testsuite/23_containers/multimap/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/set/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/unordered_set/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/multiset/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/unordered_multiset/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/map/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/vector/debug/cont_traits.h, debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/deque/debug/cont_traits.h, debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/list/debug/cont_traits.h, debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/performance/23_containers/range_construct/ list_construct1.cc: New, validate performance impact of the patch on the debug mode. * testsuite/performance/23_containers/range_construct/ list_construct2.cc: Likewise. * testsuite/performance/23_containers/range_construct/ vector_construct.cc: Likewise. * testsuite/performance/23_containers/range_construct/ deque_construct.cc: Likewise. From-SVN: r163628
2010-08-29 19:39:00 +02:00
__gnu_debug::__base(__last), __n,
__hf, __eql, __a) { }
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
unordered_map(const unordered_map&) = default;
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
libstdc++: Make debug containers prefer copy ctor to base ctor (PR 90102) When given a type which can convert to any container-like type, the C(const C&) copy constructor and C(const C::_Base&) converting constructor are ambiguous. This change replaces the converting constructor's parameter with a reference_wrapper-like type so that calling that constructor requires an additional user-defined conversion. This gives it a lower rank than the copy constructor, avoiding the ambiguity. While testing this change I discovered that __gnu_debug::forward_list doesn't have a convering constructor from the std::forward_list base, so this adds it. We should probably consider whether the converting constructors should be 'explicit' but I'm not changing that now. libstdc++-v3/ChangeLog: PR libstdc++/90102 * include/debug/deque (deque(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/forward_list (forward_list(_Base_ref)): New constructor. * include/debug/list (list(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/map.h (map(const _Base&)): Likewise. * include/debug/multimap.h (multimap(const _Base&)): Likewise. * include/debug/multiset.h (multiset(const _Base&)): Likewise. * include/debug/set.h (set(const _Base&)): Likewise. * include/debug/unordered_map (unordered_map(const _Base&)) (unordered_multimap(const _Base&)): Likewise. * include/debug/unordered_set (unordered_set(const _Base&)) (unordered_multiset(const _Base&)): Likewise. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adjust dg-error line number. * include/debug/vector (vector(const _Base&)): Likewise. * testsuite/23_containers/deque/debug/90102.cc: New test. * testsuite/23_containers/forward_list/debug/90102.cc: New test. * testsuite/23_containers/list/debug/90102.cc: New test. * testsuite/23_containers/map/debug/90102.cc: New test. * testsuite/23_containers/multimap/debug/90102.cc: New test. * testsuite/23_containers/multiset/debug/90102.cc: New test. * testsuite/23_containers/set/debug/90102.cc: New test. * testsuite/23_containers/unordered_map/debug/90102.cc: New test. * testsuite/23_containers/unordered_multimap/debug/90102.cc: New test. * testsuite/23_containers/unordered_multiset/debug/90102.cc: New test. * testsuite/23_containers/unordered_set/debug/90102.cc: New test. * testsuite/23_containers/vector/debug/90102.cc: New test.
2020-06-02 19:13:08 +02:00
unordered_map(_Base_ref __x)
: _Base(__x._M_ref) { }
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
unordered_map(unordered_map&&) = default;
explicit
unordered_map(const allocator_type& __a)
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
: _Base(__a) { }
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
unordered_map(const unordered_map& __umap,
const allocator_type& __a)
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
: _Base(__umap, __a) { }
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
unordered_map(unordered_map&& __umap,
const allocator_type& __a)
libstdc++: [_GLIBCXX_DEBUG] Remove _Safe_container<>::_M_safe() _GLIBCXX_DEBUG container code cleanup to get rid of _Safe_container<>::_M_safe() and just use _Safe:: calls which use normal inheritance. Also remove several usages of _M_base() which can be most of the time ommitted and sometimes replace with explicit _Base:: calls. libstdc++-v3/ChangeLog: * include/debug/safe_container.h (_Safe_container<>::_M_safe): Remove. * include/debug/deque (deque::operator=(initializer_list<>)): Replace _M_base() call with _Base:: call. (deque::operator[](size_type)): Likewise. * include/debug/forward_list (forward_list(forward_list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (forward_list::operator=(initializer_list<>)): Remove _M_base() calls. (forward_list::splice_after, forward_list::merge): Likewise. * include/debug/list (list(list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (list::operator=(initializer_list<>)): Remove _M_base() calls. (list::splice, list::merge): Likewise. * include/debug/map.h (map(map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (map::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multimap.h (multimap(multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multimap::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/set.h (set(set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (set::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multiset.h (multiset(multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multiset::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/string (basic_string(basic_string&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (basic_string::operator=(initializer_list<>)): Remove _M_base() call. (basic_string::operator=(const _CharT*), basic_string::operator=(_CharT)): Likewise. (basic_string::operator[](size_type), basic_string::operator+=(const basic_string&)): Likewise. (basic_string::operator+=(const _Char*), basic_string::operator+=(_CharT)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_map::operator=(initializer_list<>), unordered_map::merge): Remove _M_base() calls. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multimap::operator=(initializer_list<>), unordered_multimap::merge): Remove _M_base() calls. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_set::operator=(initializer_list<>), unordered_set::merge): Remove _M_base() calls. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multiset::operator=(initializer_list<>), unordered_multiset::merge): Remove _M_base() calls. * include/debug/vector (vector(vector&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (vector::operator=(initializer_list<>)): Remove _M_base() calls. (vector::operator[](size_type)): Likewise.
2021-11-12 07:26:33 +01:00
noexcept( noexcept(_Base(std::move(__umap), __a)) )
: _Safe(std::move(__umap), __a),
_Base(std::move(__umap), __a) { }
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
unordered_map(initializer_list<value_type> __l,
hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. 2010-08-13 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. (operator=(_Hashtable&&)): Define. * include/bits/unordered_map.h (unordered_map(unordered_map&&), unordered_map(const unordered_map&), unordered_multimap (unordered_multimap&&), unordered_multimap(const unordered_multimap&), __unordered_map(__unordered_map&&), __unordered_map(const __unordered_map&), __unordered_multimap(__unordered_multimap&&), __unordered_multimap(const __unordered_multimap&)): Do not define, leave implicit. * include/bits/unordered_set.h (unordered_set(unordered_set&&), unordered_set(const unordered_set&), unordered_multiset (unordered_multiset&&), unordered_multiset(const unordered_multiset&), __unordered_set(__unordered_set&&), __unordered_set(const __unordered_set&), __unordered_multiset(__unordered_multiset&&), __unordered_multiset(const __unordered_multiset&)): Likewise. * include/bits/unordered_map.h (__unordered_map(initializer_list<>), __unordered_map<>::operator=(initializer_list<>), __unordered_multimap(initializer_list<>), __unordered_multimap<>:: operator=(initializer_list<>)): Add. * include/bits/unordered_set.h (__unordered_set(initializer_list<>), __unordered_set<>::operator=(initializer_list<>), __unordered_multiset(initializer_list<>), __unordered_multiset<>:: operator=(initializer_list<>)): Likewise. * include/bits/unordered_map.h (__unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Fix __n default to 0. * include/bits/unordered_set.h (__unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. From-SVN: r163236
2010-08-14 03:00:23 +02:00
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a) { }
unordered_map(size_type __n, const allocator_type& __a)
: unordered_map(__n, hasher(), key_equal(), __a)
{ }
unordered_map(size_type __n,
const hasher& __hf,
const allocator_type& __a)
: unordered_map(__n, __hf, key_equal(), __a)
{ }
template<typename _InputIterator>
unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n,
const allocator_type& __a)
libstdc++: Fix unordered containers move constructors noexcept qualification _Hashtable move constructor is wrongly qualified as noexcept(true) regardless of _Equal and _H1 copy constructor qualifications. _Hashtable allocator-aware move constructor is missing its noexcept qualification like the depending unordered containers ones. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type)): Add noexcept qualification. (_Hashtable(_Hashtable&&)): Fix noexcept qualification. (_Hashtable(_Hashtable&&, const allocator_type&)): Add noexcept qualification. * include/bits/unordered_map.h (unordered_map(unordered_map&&, const allocator_type&)): Add noexcept qualification. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/bits/unordered_set.h (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Likewise. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * testsuite/23_containers/unordered_map/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_map/modifiers/move_assign.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_set/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc: New test.
2020-01-20 19:15:43 +01:00
: unordered_map(__first, __last, __n, hasher(), key_equal(), __a)
{ }
template<typename _InputIterator>
unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n,
const hasher& __hf,
const allocator_type& __a)
libstdc++: Fix unordered containers move constructors noexcept qualification _Hashtable move constructor is wrongly qualified as noexcept(true) regardless of _Equal and _H1 copy constructor qualifications. _Hashtable allocator-aware move constructor is missing its noexcept qualification like the depending unordered containers ones. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type)): Add noexcept qualification. (_Hashtable(_Hashtable&&)): Fix noexcept qualification. (_Hashtable(_Hashtable&&, const allocator_type&)): Add noexcept qualification. * include/bits/unordered_map.h (unordered_map(unordered_map&&, const allocator_type&)): Add noexcept qualification. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/bits/unordered_set.h (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Likewise. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * testsuite/23_containers/unordered_map/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_map/modifiers/move_assign.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_set/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc: New test.
2020-01-20 19:15:43 +01:00
: unordered_map(__first, __last, __n, __hf, key_equal(), __a)
{ }
unordered_map(initializer_list<value_type> __l,
size_type __n,
const allocator_type& __a)
libstdc++: Fix unordered containers move constructors noexcept qualification _Hashtable move constructor is wrongly qualified as noexcept(true) regardless of _Equal and _H1 copy constructor qualifications. _Hashtable allocator-aware move constructor is missing its noexcept qualification like the depending unordered containers ones. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type)): Add noexcept qualification. (_Hashtable(_Hashtable&&)): Fix noexcept qualification. (_Hashtable(_Hashtable&&, const allocator_type&)): Add noexcept qualification. * include/bits/unordered_map.h (unordered_map(unordered_map&&, const allocator_type&)): Add noexcept qualification. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/bits/unordered_set.h (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Likewise. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * testsuite/23_containers/unordered_map/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_map/modifiers/move_assign.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_set/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc: New test.
2020-01-20 19:15:43 +01:00
: unordered_map(__l, __n, hasher(), key_equal(), __a)
{ }
unordered_map(initializer_list<value_type> __l,
size_type __n,
const hasher& __hf,
const allocator_type& __a)
libstdc++: Fix unordered containers move constructors noexcept qualification _Hashtable move constructor is wrongly qualified as noexcept(true) regardless of _Equal and _H1 copy constructor qualifications. _Hashtable allocator-aware move constructor is missing its noexcept qualification like the depending unordered containers ones. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type)): Add noexcept qualification. (_Hashtable(_Hashtable&&)): Fix noexcept qualification. (_Hashtable(_Hashtable&&, const allocator_type&)): Add noexcept qualification. * include/bits/unordered_map.h (unordered_map(unordered_map&&, const allocator_type&)): Add noexcept qualification. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/bits/unordered_set.h (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Likewise. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * testsuite/23_containers/unordered_map/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_map/modifiers/move_assign.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_set/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc: New test.
2020-01-20 19:15:43 +01:00
: unordered_map(__l, __n, __hf, key_equal(), __a)
{ }
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
~unordered_map() = default;
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. (_Hashtable<>::~_Hashtable): Use noexcept. * include/bits/stl_list.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use std::move on the allocator. (_Rb_tree<>::~_Rb_tree): Use noexcept. * include/bits/stl_deque.h: Likewise. * include/bits/basic_string.h (basic_string<>::~basic_string): Use noexcept. * include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise. * include/debug/set.h: Adjust. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/forward_list: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/ noexcept_move_construct.cc: New. * testsuite/21_strings/basic_string/cons/char/ noexcept_move_construct.cc: Likewise. * testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_map/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/forward_list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/bool/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/map/cons/noexcept_move_construct.cc * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * include/bits/move.h (swap): Use __and_ in the noexcept. * include/bits/algorithmfwd.h: Adjust. From-SVN: r174525
2011-06-01 16:16:19 +02:00
unordered_map&
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
operator=(const unordered_map&) = default;
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
unordered_map&
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
operator=(unordered_map&&) = default;
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
unordered_map&
operator=(initializer_list<value_type> __l)
{
libstdc++: [_GLIBCXX_DEBUG] Remove _Safe_container<>::_M_safe() _GLIBCXX_DEBUG container code cleanup to get rid of _Safe_container<>::_M_safe() and just use _Safe:: calls which use normal inheritance. Also remove several usages of _M_base() which can be most of the time ommitted and sometimes replace with explicit _Base:: calls. libstdc++-v3/ChangeLog: * include/debug/safe_container.h (_Safe_container<>::_M_safe): Remove. * include/debug/deque (deque::operator=(initializer_list<>)): Replace _M_base() call with _Base:: call. (deque::operator[](size_type)): Likewise. * include/debug/forward_list (forward_list(forward_list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (forward_list::operator=(initializer_list<>)): Remove _M_base() calls. (forward_list::splice_after, forward_list::merge): Likewise. * include/debug/list (list(list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (list::operator=(initializer_list<>)): Remove _M_base() calls. (list::splice, list::merge): Likewise. * include/debug/map.h (map(map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (map::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multimap.h (multimap(multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multimap::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/set.h (set(set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (set::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multiset.h (multiset(multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multiset::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/string (basic_string(basic_string&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (basic_string::operator=(initializer_list<>)): Remove _M_base() call. (basic_string::operator=(const _CharT*), basic_string::operator=(_CharT)): Likewise. (basic_string::operator[](size_type), basic_string::operator+=(const basic_string&)): Likewise. (basic_string::operator+=(const _Char*), basic_string::operator+=(_CharT)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_map::operator=(initializer_list<>), unordered_map::merge): Remove _M_base() calls. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multimap::operator=(initializer_list<>), unordered_multimap::merge): Remove _M_base() calls. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_set::operator=(initializer_list<>), unordered_set::merge): Remove _M_base() calls. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multiset::operator=(initializer_list<>), unordered_multiset::merge): Remove _M_base() calls. * include/debug/vector (vector(vector&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (vector::operator=(initializer_list<>)): Remove _M_base() calls. (vector::operator[](size_type)): Likewise.
2021-11-12 07:26:33 +01:00
_Base::operator=(__l);
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
this->_M_invalidate_all();
return *this;
}
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::get_allocator;
using _Base::empty;
using _Base::size;
using _Base::max_size;
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
void
stl_pair.h (swap): Do not swap rvalues. 2009-05-18 Jonathan Wakely <jwakely.gcc@gmail.com> * include/bits/stl_pair.h (swap): Do not swap rvalues. * include/bits/stl_deque.h (swap): Likewise. * include/bits/stl_list.h (swap): Likewise. * include/bits/stl_vector.h (swap): Likewise. * include/bits/stl_bvector.h (swap): Likewise. * include/bits/stl_queue.h (swap): Likewise. * include/bits/stl_stack.h (swap): Likewise. * include/bits/stl_tree.h (swap): Likewise. * include/bits/stl_map.h (swap): Likewise. * include/bits/stl_multimap.h (swap): Likewise. * include/bits/stl_set.h (swap): Likewise. * include/bits/stl_multiset.h (swap): Likewise. * include/bits/forward_list.h (swap): Likewise. * include/bits/unique_ptr.h (swap): Likewise. * include/debug/deque (swap): Likewise. * include/debug/list (swap): Likewise. * include/debug/vector (swap): Likewise. * include/debug/map.h (swap): Likewise. * include/debug/multimap.h (swap): Likewise. * include/debug/set.h (swap): Likewise. * include/debug/multiset.h (swap): Likewise. * include/debug/unordered_map (swap): Likewise. * include/debug/unordered_set (swap): Likewise. * include/ext/vstring.h (swap): Likewise. * include/tr1_impl/unordered_map (swap): Likewise. * include/tr1_impl/hashtable (swap): Likewise. * include/tr1_impl/unordered_set (swap): Likewise. * include/std/tuple (swap): Likewise. * include/std/mutex (swap): Likewise. * include/std/thread (swap): Likewise. (operator<<): Only output to lvalue streams. * testsuite/20_util/shared_ptr/modifiers/swap_rvalue.cc: Remove. * testsuite/23_containers/headers/forward_list/synopsis.cc: Adjust. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Adjust line numbers. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/30_threads/thread/swap/1.cc: Swap with lvalue and also test non-member swap. * testsuite/30_threads/thread/swap/2.cc: Remove. From-SVN: r147678
2009-05-19 00:15:56 +02:00
swap(unordered_map& __x)
c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/forward_list.h (forward_list::swap): Make noexcept unconditional. * include/bits/hashtable.h (_Hashtable::swap): Do not use _S_nothrow_swap(). * include/bits/stl_bvector.h (vector<bool>::swap): Make noexcept unconditional. * include/bits/stl_deque.h (deque::swap): Likewise. (swap(deque&, deque&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_list.h (list::swap): Make noexcept unconditional. (swap(list&, list&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_map.h (map::swap, swap(map&, map&)): Use _GLIBCXX_NOEXCEPT_IF, do not depend on _S_nothrow_swap. * include/bits/stl_multimap.h (multimap::swap, swap(multimap&, multimap&)): Likewise. * include/bits/stl_multiset.h (multiset::swap, swap(multiset&, multiset&)): Likewise. * include/bits/stl_set.h (set::swap, swap(set&, set&)): Likewise. * include/bits/stl_tree.h (_Rb_tree::swap, swap(_Rb_tree&, _Rb_tree&)): Likewise. * include/bits/stl_vector.h (vector::swap): Make noexcept unconditional. (swap(vector&, vector&)): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/deque (deque::swap, swap): Likewise. * include/debug/forward_list (swap): Add noexcept. * include/debug/list (list::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/map.h (map::swap, swap): Likewise. * include/debug/multimap.h (multimap::swap, swap): Likewise. * include/debug/multiset.h (multiset::Swap, swap): Likewise. * include/debug/set.h (set::swap, swap): Likewise. * include/debug/unordered_map (unordered_map::swap, unordered_multimap::swap, swap): Likewise. * include/debug/unordered_set (unordered_set::swap, unordered_multiset::swap, swap): Likewise. * include/debug/vector (vector::swap, swap): Likewise. * include/ext/alloc_traits.h (__alloc_traits::_S_nothrow_swap()): Remove. * include/profile/deque (deque::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/profile/forward_list (swap): Add noexcept. * include/profile/list (list::swap, swap) : Use _GLIBCXX_NOEXCEPT_IF. * include/profile/map.h (map::swap, swap): Likewise. * include/profile/multimap.h (multimap::swap, swap): Likewise. * include/profile/multiset.h (multiset::swap, swap): Likewise. * include/profile/set.h (set::swap, swap): Likewise. * include/profile/unordered_map (swap): Likewise. * include/profile/unordered_set (swap): Likewise. * include/profile/vector (vector::swap, swap): Likewise. Remove overloads for swapping rvalues. * testsuite/23_containers/deque/allocator/noexcept.cc: Update tests for noexcept on swap. * testsuite/23_containers/forward_list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/bool/allocator/noexcept.cc: Likewise. * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line number. From-SVN: r225744
2015-07-13 19:15:48 +02:00
noexcept( noexcept(declval<_Base&>().swap(__x)) )
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
{
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
_Safe::_M_swap(__x);
_Base::swap(__x);
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
}
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
void
clear() noexcept
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
{
_Base::clear();
this->_M_invalidate_all();
}
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
iterator
begin() noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::begin(), this }; }
const_iterator
begin() const noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::begin(), this }; }
iterator
end() noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::end(), this }; }
const_iterator
end() const noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::end(), this }; }
const_iterator
cbegin() const noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::cbegin(), this }; }
const_iterator
cend() const noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::cend(), this }; }
// local versions
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
local_iterator
begin(size_type __b)
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::begin(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
local_iterator
end(size_type __b)
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::end(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
const_local_iterator
begin(size_type __b) const
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::begin(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
const_local_iterator
end(size_type __b) const
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::end(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
const_local_iterator
cbegin(size_type __b) const
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::cbegin(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
const_local_iterator
cend(size_type __b) const
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::cend(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::bucket_count;
using _Base::max_bucket_count;
using _Base::bucket;
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
size_type
bucket_size(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return _Base::bucket_size(__b);
}
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::load_factor;
float
max_load_factor() const noexcept
{ return _Base::max_load_factor(); }
void
max_load_factor(float __f)
{
__glibcxx_check_max_load_factor(__f);
_Base::max_load_factor(__f);
}
template<typename... _Args>
std::pair<iterator, bool>
emplace(_Args&&... __args)
{
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __res = _Base::emplace(std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { { __res.first, this }, __res.second };
}
template<typename... _Args>
iterator
emplace_hint(const_iterator __hint, _Args&&... __args)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __it = _Base::emplace_hint(__hint.base(),
std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
}
std::pair<iterator, bool>
insert(const value_type& __obj)
{
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
size_type __bucket_count = this->bucket_count();
auto __res = _Base::insert(__obj);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { { __res.first, this }, __res.second };
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
std::pair<iterator, bool>
insert(value_type&& __x)
{
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
size_type __bucket_count = this->bucket_count();
auto __res = _Base::insert(std::move(__x));
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { { __res.first, this }, __res.second };
}
2010-10-28 18:01:05 +02:00
template<typename _Pair, typename = typename
std::enable_if<std::is_constructible<value_type,
_Pair&&>::value>::type>
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
std::pair<iterator, bool>
insert(_Pair&& __obj)
{
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __res = _Base::insert(std::forward<_Pair>(__obj));
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { { __res.first, this }, __res.second };
2010-10-28 18:01:05 +02:00
}
iterator
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __it = _Base::insert(__hint.base(), __obj);
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(const_iterator __hint, value_type&& __x)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(__hint.base(), std::move(__x));
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
}
2010-10-28 18:01:05 +02:00
template<typename _Pair, typename = typename
std::enable_if<std::is_constructible<value_type,
_Pair&&>::value>::type>
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
iterator
insert(const_iterator __hint, _Pair&& __obj)
{
__glibcxx_check_insert(__hint);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __it = _Base::insert(__hint.base(), std::forward<_Pair>(__obj));
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
2010-10-28 18:01:05 +02:00
}
void
insert(std::initializer_list<value_type> __l)
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
{
size_type __bucket_count = this->bucket_count();
_Base::insert(__l);
_M_check_rehashed(__bucket_count);
}
template<typename _InputIterator>
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
void
insert(_InputIterator __first, _InputIterator __last)
{
stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. 2015-06-29 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. * include/debug/functions.h (__gnu_debug::__valid_range, __gnu_debug::__base): Move... * include/debug/safe_iterator.h (__gnu_debug::_Sequence_traits): New. (__gnu_debug::__get_distance_from_begin): New. (__gnu_debug::__get_distance_to_end): New. (__gnu_debug::_Safe_iterator<>::_M_valid_range): Expose iterator range distance information. Add optional check_dereferenceable parameter, default true. (__gnu_debug::_Distance_precision, __gnu_debug::__get_distance): Move default definition... (__gnu_debug::__get_distance): New overload for _Safe_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/helper_functions.h: ...here. New. (__gnu_debug::__unsafe): New helper function to remove safe iterator layer. * include/debug/stl_iterator.h: New. Include latter. * include/bits/stl_iterator.h: Include latter in debug mode. * include/debug/stl_iterator.tcc: Adapt. * include/debug/safe_local_iterator.h (__gnu_debug::__get_distance): Add overload for _Safe_local_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/safe_local_iterator.tcc: Adapt. * include/debug/macros.h (__glibcxx_check_valid_range2): New. (__glibcxx_check_insert_range): Add _Dist parameter. (__glibcxx_check_insert_range_after): Likewise. (__glibcxx_check_string, __glibcxx_check_string_len): Implement using _GLIBCXX_DEBUG_PEDASSERT. * include/debug/deque (deque<>::assign): Remove iterator debug layer when possible. (deque<>::insert): Likewise. * include/debug/forward_list (__glibcxx_check_valid_fl_range): New. (forward_list<>::splice_after): Use latter. (forward_list<>::assign): Remove iterator debug layer when possible. (forward_list<>::insert_after): Likewise. (__gnu_debug::_Sequence_traits<>): Partial specialization. * include/debug/list (list<>::assign): Remove iterator debug layer when possible. (list<>::insert): Likewise. [__gnu_debug::_Sequence_traits<>]: Partial specialization pre C++11 ABI. * include/debug/map.h (map<>::insert): Remove iterator debug layer when possible. * include/debug/multimap.h (multimap<>::insert): Likewise. * include/debug/set.h (set<>::insert): Likewise. * include/debug/multiset.h (multiset<>::insert): Likewise. * include/debug/string (basic_string<>::append, basic_string<>::assign, basic_string<>::insert, basic_string<>::replace): Likewise. * include/debug/unordered_map (unordered_map<>::insert, unordered_multimap<>::insert): Likewise. * include/debug/unordered_set (unordered_set<>::insert, unordered_multiset<>insert): Likewise. * include/debug/vector (vector<>::assign, vector<>::insert): Likewise. * include/Makefile.am: Add new debug headers. * include/Makefile.in: Regenerate. From-SVN: r225143
2015-06-29 22:17:56 +02:00
typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
__glibcxx_check_valid_range2(__first, __last, __dist);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
size_type __bucket_count = this->bucket_count();
stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. 2015-06-29 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. * include/debug/functions.h (__gnu_debug::__valid_range, __gnu_debug::__base): Move... * include/debug/safe_iterator.h (__gnu_debug::_Sequence_traits): New. (__gnu_debug::__get_distance_from_begin): New. (__gnu_debug::__get_distance_to_end): New. (__gnu_debug::_Safe_iterator<>::_M_valid_range): Expose iterator range distance information. Add optional check_dereferenceable parameter, default true. (__gnu_debug::_Distance_precision, __gnu_debug::__get_distance): Move default definition... (__gnu_debug::__get_distance): New overload for _Safe_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/helper_functions.h: ...here. New. (__gnu_debug::__unsafe): New helper function to remove safe iterator layer. * include/debug/stl_iterator.h: New. Include latter. * include/bits/stl_iterator.h: Include latter in debug mode. * include/debug/stl_iterator.tcc: Adapt. * include/debug/safe_local_iterator.h (__gnu_debug::__get_distance): Add overload for _Safe_local_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/safe_local_iterator.tcc: Adapt. * include/debug/macros.h (__glibcxx_check_valid_range2): New. (__glibcxx_check_insert_range): Add _Dist parameter. (__glibcxx_check_insert_range_after): Likewise. (__glibcxx_check_string, __glibcxx_check_string_len): Implement using _GLIBCXX_DEBUG_PEDASSERT. * include/debug/deque (deque<>::assign): Remove iterator debug layer when possible. (deque<>::insert): Likewise. * include/debug/forward_list (__glibcxx_check_valid_fl_range): New. (forward_list<>::splice_after): Use latter. (forward_list<>::assign): Remove iterator debug layer when possible. (forward_list<>::insert_after): Likewise. (__gnu_debug::_Sequence_traits<>): Partial specialization. * include/debug/list (list<>::assign): Remove iterator debug layer when possible. (list<>::insert): Likewise. [__gnu_debug::_Sequence_traits<>]: Partial specialization pre C++11 ABI. * include/debug/map.h (map<>::insert): Remove iterator debug layer when possible. * include/debug/multimap.h (multimap<>::insert): Likewise. * include/debug/set.h (set<>::insert): Likewise. * include/debug/multiset.h (multiset<>::insert): Likewise. * include/debug/string (basic_string<>::append, basic_string<>::assign, basic_string<>::insert, basic_string<>::replace): Likewise. * include/debug/unordered_map (unordered_map<>::insert, unordered_multimap<>::insert): Likewise. * include/debug/unordered_set (unordered_set<>::insert, unordered_multiset<>insert): Likewise. * include/debug/vector (vector<>::assign, vector<>::insert): Likewise. * include/Makefile.am: Add new debug headers. * include/Makefile.in: Regenerate. From-SVN: r225143
2015-06-29 22:17:56 +02:00
if (__dist.second >= __gnu_debug::__dp_sign)
_Base::insert(__gnu_debug::__unsafe(__first),
__gnu_debug::__unsafe(__last));
else
_Base::insert(__first, __last);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
}
#if __cplusplus > 201402L
template <typename... _Args>
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
pair<iterator, bool>
try_emplace(const key_type& __k, _Args&&... __args)
{
auto __res = _Base::try_emplace(__k,
std::forward<_Args>(__args)...);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { { __res.first, this }, __res.second };
}
template <typename... _Args>
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
pair<iterator, bool>
try_emplace(key_type&& __k, _Args&&... __args)
{
auto __res = _Base::try_emplace(std::move(__k),
std::forward<_Args>(__args)...);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { { __res.first, this }, __res.second };
}
template <typename... _Args>
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
iterator
try_emplace(const_iterator __hint, const key_type& __k,
_Args&&... __args)
{
__glibcxx_check_insert(__hint);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::try_emplace(__hint.base(), __k,
std::forward<_Args>(__args)...),
this };
}
template <typename... _Args>
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
iterator
try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
{
__glibcxx_check_insert(__hint);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::try_emplace(__hint.base(), std::move(__k),
std::forward<_Args>(__args)...),
this };
}
template <typename _Obj>
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
pair<iterator, bool>
insert_or_assign(const key_type& __k, _Obj&& __obj)
{
auto __res = _Base::insert_or_assign(__k,
std::forward<_Obj>(__obj));
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { { __res.first, this }, __res.second };
}
template <typename _Obj>
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
pair<iterator, bool>
insert_or_assign(key_type&& __k, _Obj&& __obj)
{
auto __res = _Base::insert_or_assign(std::move(__k),
std::forward<_Obj>(__obj));
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { { __res.first, this }, __res.second };
}
template <typename _Obj>
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
iterator
insert_or_assign(const_iterator __hint, const key_type& __k,
_Obj&& __obj)
{
__glibcxx_check_insert(__hint);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::insert_or_assign(__hint.base(), __k,
std::forward<_Obj>(__obj)),
this };
}
template <typename _Obj>
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
iterator
insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj)
{
__glibcxx_check_insert(__hint);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::insert_or_assign(__hint.base(), std::move(__k),
std::forward<_Obj>(__obj)),
this };
}
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
#endif // C++17
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
#if __cplusplus > 201402L
using node_type = typename _Base::node_type;
using insert_return_type = _Node_insert_return<iterator, node_type>;
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
node_type
extract(const_iterator __position)
{
__glibcxx_check_erase(__position);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return _M_extract(__position.base());
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
}
node_type
extract(const key_type& __key)
{
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
const auto __position = _Base::find(__key);
if (__position != _Base::end())
return _M_extract(__position);
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
return {};
}
insert_return_type
insert(node_type&& __nh)
{
auto __ret = _Base::insert(std::move(__nh));
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return
{ { __ret.position, this }, __ret.inserted, std::move(__ret.node) };
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
}
iterator
insert(const_iterator __hint, node_type&& __nh)
{
__glibcxx_check_insert(__hint);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::insert(__hint.base(), std::move(__nh)), this };
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
}
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
template<typename _H2, typename _P2>
void
merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source)
{
auto __guard
= _Safe::_S_uc_guard(std::__detail::_Select1st{}, __source);
libstdc++: [_GLIBCXX_DEBUG] Remove _Safe_container<>::_M_safe() _GLIBCXX_DEBUG container code cleanup to get rid of _Safe_container<>::_M_safe() and just use _Safe:: calls which use normal inheritance. Also remove several usages of _M_base() which can be most of the time ommitted and sometimes replace with explicit _Base:: calls. libstdc++-v3/ChangeLog: * include/debug/safe_container.h (_Safe_container<>::_M_safe): Remove. * include/debug/deque (deque::operator=(initializer_list<>)): Replace _M_base() call with _Base:: call. (deque::operator[](size_type)): Likewise. * include/debug/forward_list (forward_list(forward_list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (forward_list::operator=(initializer_list<>)): Remove _M_base() calls. (forward_list::splice_after, forward_list::merge): Likewise. * include/debug/list (list(list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (list::operator=(initializer_list<>)): Remove _M_base() calls. (list::splice, list::merge): Likewise. * include/debug/map.h (map(map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (map::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multimap.h (multimap(multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multimap::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/set.h (set(set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (set::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multiset.h (multiset(multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multiset::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/string (basic_string(basic_string&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (basic_string::operator=(initializer_list<>)): Remove _M_base() call. (basic_string::operator=(const _CharT*), basic_string::operator=(_CharT)): Likewise. (basic_string::operator[](size_type), basic_string::operator+=(const basic_string&)): Likewise. (basic_string::operator+=(const _Char*), basic_string::operator+=(_CharT)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_map::operator=(initializer_list<>), unordered_map::merge): Remove _M_base() calls. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multimap::operator=(initializer_list<>), unordered_multimap::merge): Remove _M_base() calls. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_set::operator=(initializer_list<>), unordered_set::merge): Remove _M_base() calls. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multiset::operator=(initializer_list<>), unordered_multiset::merge): Remove _M_base() calls. * include/debug/vector (vector(vector&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (vector::operator=(initializer_list<>)): Remove _M_base() calls. (vector::operator[](size_type)): Likewise.
2021-11-12 07:26:33 +01:00
_Base::merge(__source);
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
}
template<typename _H2, typename _P2>
void
merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
{ merge(__source); }
template<typename _H2, typename _P2>
void
merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
{
auto __guard
= _Safe::_S_umc_guard(std::__detail::_Select1st{}, __source);
libstdc++: [_GLIBCXX_DEBUG] Remove _Safe_container<>::_M_safe() _GLIBCXX_DEBUG container code cleanup to get rid of _Safe_container<>::_M_safe() and just use _Safe:: calls which use normal inheritance. Also remove several usages of _M_base() which can be most of the time ommitted and sometimes replace with explicit _Base:: calls. libstdc++-v3/ChangeLog: * include/debug/safe_container.h (_Safe_container<>::_M_safe): Remove. * include/debug/deque (deque::operator=(initializer_list<>)): Replace _M_base() call with _Base:: call. (deque::operator[](size_type)): Likewise. * include/debug/forward_list (forward_list(forward_list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (forward_list::operator=(initializer_list<>)): Remove _M_base() calls. (forward_list::splice_after, forward_list::merge): Likewise. * include/debug/list (list(list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (list::operator=(initializer_list<>)): Remove _M_base() calls. (list::splice, list::merge): Likewise. * include/debug/map.h (map(map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (map::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multimap.h (multimap(multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multimap::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/set.h (set(set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (set::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multiset.h (multiset(multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multiset::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/string (basic_string(basic_string&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (basic_string::operator=(initializer_list<>)): Remove _M_base() call. (basic_string::operator=(const _CharT*), basic_string::operator=(_CharT)): Likewise. (basic_string::operator[](size_type), basic_string::operator+=(const basic_string&)): Likewise. (basic_string::operator+=(const _Char*), basic_string::operator+=(_CharT)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_map::operator=(initializer_list<>), unordered_map::merge): Remove _M_base() calls. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multimap::operator=(initializer_list<>), unordered_multimap::merge): Remove _M_base() calls. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_set::operator=(initializer_list<>), unordered_set::merge): Remove _M_base() calls. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multiset::operator=(initializer_list<>), unordered_multiset::merge): Remove _M_base() calls. * include/debug/vector (vector(vector&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (vector::operator=(initializer_list<>)): Remove _M_base() calls. (vector::operator[](size_type)): Likewise.
2021-11-12 07:26:33 +01:00
_Base::merge(__source);
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
}
template<typename _H2, typename _P2>
void
merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
{ merge(__source); }
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
#endif // C++17
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::hash_function;
using _Base::key_eq;
iterator
find(const key_type& __key)
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::find(__key), this }; }
libstdc++: Add unordered containers heterogeneous lookup Add unordered containers heterogeneous lookup member functions find, count, contains and equal_range in C++20. Those members are considered for overload resolution only if hash and equal functors used to instantiate the container have a nested is_transparent type. libstdc++-v3/ChangeLog: * include/bits/stl_tree.h (__has_is_transparent, __has_is_transparent_t): Move... * include/bits/stl_function.h: ...here. * include/bits/hashtable_policy.h (_Hash_code_base<>::_M_hash_code_tr): New.. (_Hashtable_base<>::_M_equals_tr): New. * include/bits/hashtable.h (_Hashtable<>::_M_find_tr, _Hashtable<>::_M_count_tr, _Hashtable<>::_M_equal_range_tr): New member function templates to perform heterogeneous lookup. (_Hashtable<>::_M_find_before_node_tr): New. (_Hashtable<>::_M_find_node_tr): New. * include/bits/unordered_map.h (unordered_map::find<>, unordered_map::count<>, unordered_map::contains<>, unordered_map::equal_range<>): New member function templates to perform heterogeneous lookup. (unordered_multimap::find<>, unordered_multimap::count<>, unordered_multimap::contains<>, unordered_multimap::equal_range<>): Likewise. * include/bits/unordered_set.h (unordered_set::find<>, unordered_set::count<>, unordered_set::contains<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::count<>, unordered_multiset::contains<>, unordered_multiset::equal_range<>): Likewise. * include/debug/unordered_map (unordered_map::find<>, unordered_map::equal_range<>): Likewise. (unordered_multimap::find<>, unordered_multimap::equal_range<>): Likewise. * include/debug/unordered_set (unordered_set::find<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::equal_range<>): Likewise. * testsuite/23_containers/unordered_map/operations/1.cc: New test. * testsuite/23_containers/unordered_multimap/operations/1.cc: New test. * testsuite/23_containers/unordered_multiset/operations/1.cc: New test. * testsuite/23_containers/unordered_set/operations/1.cc: New test.
2020-11-30 20:57:16 +01:00
#if __cplusplus > 201703L
template<typename _Kt,
typename = std::__has_is_transparent_t<_Hash, _Kt>,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
iterator
find(const _Kt& __k)
{ return { _Base::find(__k), this }; }
#endif
const_iterator
find(const key_type& __key) const
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::find(__key), this }; }
libstdc++: Add unordered containers heterogeneous lookup Add unordered containers heterogeneous lookup member functions find, count, contains and equal_range in C++20. Those members are considered for overload resolution only if hash and equal functors used to instantiate the container have a nested is_transparent type. libstdc++-v3/ChangeLog: * include/bits/stl_tree.h (__has_is_transparent, __has_is_transparent_t): Move... * include/bits/stl_function.h: ...here. * include/bits/hashtable_policy.h (_Hash_code_base<>::_M_hash_code_tr): New.. (_Hashtable_base<>::_M_equals_tr): New. * include/bits/hashtable.h (_Hashtable<>::_M_find_tr, _Hashtable<>::_M_count_tr, _Hashtable<>::_M_equal_range_tr): New member function templates to perform heterogeneous lookup. (_Hashtable<>::_M_find_before_node_tr): New. (_Hashtable<>::_M_find_node_tr): New. * include/bits/unordered_map.h (unordered_map::find<>, unordered_map::count<>, unordered_map::contains<>, unordered_map::equal_range<>): New member function templates to perform heterogeneous lookup. (unordered_multimap::find<>, unordered_multimap::count<>, unordered_multimap::contains<>, unordered_multimap::equal_range<>): Likewise. * include/bits/unordered_set.h (unordered_set::find<>, unordered_set::count<>, unordered_set::contains<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::count<>, unordered_multiset::contains<>, unordered_multiset::equal_range<>): Likewise. * include/debug/unordered_map (unordered_map::find<>, unordered_map::equal_range<>): Likewise. (unordered_multimap::find<>, unordered_multimap::equal_range<>): Likewise. * include/debug/unordered_set (unordered_set::find<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::equal_range<>): Likewise. * testsuite/23_containers/unordered_map/operations/1.cc: New test. * testsuite/23_containers/unordered_multimap/operations/1.cc: New test. * testsuite/23_containers/unordered_multiset/operations/1.cc: New test. * testsuite/23_containers/unordered_set/operations/1.cc: New test.
2020-11-30 20:57:16 +01:00
#if __cplusplus > 201703L
template<typename _Kt,
typename = std::__has_is_transparent_t<_Hash, _Kt>,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
const_iterator
find(const _Kt& __k) const
{ return { _Base::find(__k), this }; }
#endif
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::count;
#if __cplusplus > 201703L
using _Base::contains;
#endif
std::pair<iterator, iterator>
equal_range(const key_type& __key)
{
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __res = _Base::equal_range(__key);
return { { __res.first, this }, { __res.second, this } };
}
libstdc++: Add unordered containers heterogeneous lookup Add unordered containers heterogeneous lookup member functions find, count, contains and equal_range in C++20. Those members are considered for overload resolution only if hash and equal functors used to instantiate the container have a nested is_transparent type. libstdc++-v3/ChangeLog: * include/bits/stl_tree.h (__has_is_transparent, __has_is_transparent_t): Move... * include/bits/stl_function.h: ...here. * include/bits/hashtable_policy.h (_Hash_code_base<>::_M_hash_code_tr): New.. (_Hashtable_base<>::_M_equals_tr): New. * include/bits/hashtable.h (_Hashtable<>::_M_find_tr, _Hashtable<>::_M_count_tr, _Hashtable<>::_M_equal_range_tr): New member function templates to perform heterogeneous lookup. (_Hashtable<>::_M_find_before_node_tr): New. (_Hashtable<>::_M_find_node_tr): New. * include/bits/unordered_map.h (unordered_map::find<>, unordered_map::count<>, unordered_map::contains<>, unordered_map::equal_range<>): New member function templates to perform heterogeneous lookup. (unordered_multimap::find<>, unordered_multimap::count<>, unordered_multimap::contains<>, unordered_multimap::equal_range<>): Likewise. * include/bits/unordered_set.h (unordered_set::find<>, unordered_set::count<>, unordered_set::contains<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::count<>, unordered_multiset::contains<>, unordered_multiset::equal_range<>): Likewise. * include/debug/unordered_map (unordered_map::find<>, unordered_map::equal_range<>): Likewise. (unordered_multimap::find<>, unordered_multimap::equal_range<>): Likewise. * include/debug/unordered_set (unordered_set::find<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::equal_range<>): Likewise. * testsuite/23_containers/unordered_map/operations/1.cc: New test. * testsuite/23_containers/unordered_multimap/operations/1.cc: New test. * testsuite/23_containers/unordered_multiset/operations/1.cc: New test. * testsuite/23_containers/unordered_set/operations/1.cc: New test.
2020-11-30 20:57:16 +01:00
#if __cplusplus > 201703L
template<typename _Kt,
typename = std::__has_is_transparent_t<_Hash, _Kt>,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
std::pair<iterator, iterator>
equal_range(const _Kt& __k)
{
auto __res = _Base::equal_range(__k);
return { { __res.first, this }, { __res.second, this } };
}
#endif
std::pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const
{
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __res = _Base::equal_range(__key);
return { { __res.first, this }, { __res.second, this } };
}
libstdc++: Add unordered containers heterogeneous lookup Add unordered containers heterogeneous lookup member functions find, count, contains and equal_range in C++20. Those members are considered for overload resolution only if hash and equal functors used to instantiate the container have a nested is_transparent type. libstdc++-v3/ChangeLog: * include/bits/stl_tree.h (__has_is_transparent, __has_is_transparent_t): Move... * include/bits/stl_function.h: ...here. * include/bits/hashtable_policy.h (_Hash_code_base<>::_M_hash_code_tr): New.. (_Hashtable_base<>::_M_equals_tr): New. * include/bits/hashtable.h (_Hashtable<>::_M_find_tr, _Hashtable<>::_M_count_tr, _Hashtable<>::_M_equal_range_tr): New member function templates to perform heterogeneous lookup. (_Hashtable<>::_M_find_before_node_tr): New. (_Hashtable<>::_M_find_node_tr): New. * include/bits/unordered_map.h (unordered_map::find<>, unordered_map::count<>, unordered_map::contains<>, unordered_map::equal_range<>): New member function templates to perform heterogeneous lookup. (unordered_multimap::find<>, unordered_multimap::count<>, unordered_multimap::contains<>, unordered_multimap::equal_range<>): Likewise. * include/bits/unordered_set.h (unordered_set::find<>, unordered_set::count<>, unordered_set::contains<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::count<>, unordered_multiset::contains<>, unordered_multiset::equal_range<>): Likewise. * include/debug/unordered_map (unordered_map::find<>, unordered_map::equal_range<>): Likewise. (unordered_multimap::find<>, unordered_multimap::equal_range<>): Likewise. * include/debug/unordered_set (unordered_set::find<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::equal_range<>): Likewise. * testsuite/23_containers/unordered_map/operations/1.cc: New test. * testsuite/23_containers/unordered_multimap/operations/1.cc: New test. * testsuite/23_containers/unordered_multiset/operations/1.cc: New test. * testsuite/23_containers/unordered_set/operations/1.cc: New test.
2020-11-30 20:57:16 +01:00
#if __cplusplus > 201703L
template<typename _Kt,
typename = std::__has_is_transparent_t<_Hash, _Kt>,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __k) const
{
auto __res = _Base::equal_range(__k);
return { { __res.first, this }, { __res.second, this } };
}
#endif
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::operator[];
using _Base::at;
size_type
erase(const key_type& __key)
{
size_type __ret(0);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __victim = _Base::find(__key);
debug.cc: Introduce a mutex pool in get_safe_base_mutex. 2010-11-25 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Introduce a mutex pool in get_safe_base_mutex. Move code used to manipulate sequence safe iterators from safe iterator methods to safe sequence ones. Remove usage of safe iterator mutex, keep _Safe_iterator_base::_M_get_mutex for library backward binary compatibility. * src/Makefile.am: Build debug.cc in gnu++0x mode for _Hash_impl usage. * src/Makefile.in: Regenerate * include/debug/safe_base.h: Add _Safe_iterator_base _M_invalidate and _M_reset. Add _Safe_sequence_base _M_attach, _M_attach_single, _M_detach and _M_detach_single. * include/debug.safe_iterator.h, safe_iterator.tcc: Remove _Safe_iterator _M_invalidate and _M_invalidate_single. Implement all methods in terms of normal iterators rather than safe ones. * include/debug/safe_sequence.h: Replace _Safe_sequence _M_transfe_iter with _M_transfer_from_if taking the source sequence and a predicate signaling when a safe iterator shall be transfered. Add _Equal_to predicate. * include/debug/safe_sequence.tcc: New. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/debug/forward_list: Swap safe iterators in move constructor. Do not invalidate before begin in _M_invalidate_all method. Reimplement safe methods using normal iterators rather than safe ones. * include/debug/set.h, unordered_map, multiset.h, vector, unordered_set, deque, map.h, list, multimap.h: Reimplement safe method using normal iterators rather than safe ones. * testsuite/23_containers/forward_list/debug/clear.cc, swap.cc, move_constructor.cc, splice_after.cc, splice_after1.cc, splice_after2.cc, splice_after3.cc, splice_after4.cc: New. * testsuite/23_containers/vector/debug/multithreaded_swap.cc: New. From-SVN: r167152
2010-11-25 21:53:39 +01:00
if (__victim != _Base::end())
{
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
_M_erase(__victim);
__ret = 1;
}
return __ret;
}
iterator
erase(const_iterator __it)
{
__glibcxx_check_erase(__it);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _M_erase(__it.base()), this };
}
libstdc++: [_GLIBCXX_DEBUG] Reduce performance impact on std::erase_if Bypass the _GLIBCXX_DEBUG additional checks in std::__detail::__erase_node_if used by all implementations of std::erase_if for node based containers. libstdc++-v3/ChangeLog: * include/bits/erase_if.h (__erase_nodes_if): Add _UnsafeContainer template parameter. Use it to get iterators to work with. * include/debug/macros.h (__glibcxx_check_erase2): New. * include/debug/map.h (map<>::erase(_Base_const_iterator)): New. (map<>::erase(const_iterator)): Use latter. * include/debug/multimap.h (multimap<>::erase(_Base_const_iterator)): New. (multimap<>::erase(const_iterator)): Use latter. * include/debug/multiset.h (multiset<>::erase(_Base_const_iterator)): New. (multiset<>::erase(const_iterator)): Use latter. * include/debug/set.h (set<>::erase(_Base_const_iterator)): New. (set<>::erase(const_iterator)): Use latter. * include/debug/unordered_map (unordered_map<>::erase(_Base_const_iterator)): New. (unordered_multimap<>::erase(const_iterator)): New. * include/debug/unordered_set (unordered_set<>::erase(_Base_const_iterator)): New. (unordered_multiset<>::erase(const_iterator)): New. * include/experimental/map (erase_if): Adapt. * include/experimental/set (erase_if): Adapt. * include/experimental/unordered_map (erase_if): Adapt. * include/experimental/unordered_set (erase_if): Adapt. * include/std/map (erase_if): Adapt. * include/std/set (erase_if): Adapt. * include/std/unordered_map (erase_if): Adapt. * include/std/unordered_set (erase_if): Adapt.
2021-11-16 21:51:11 +01:00
_Base_iterator
erase(_Base_const_iterator __it)
{
__glibcxx_check_erase2(__it);
return _M_erase(__it);
}
2011-11-16 00:28:49 +01:00
iterator
erase(iterator __it)
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{
__glibcxx_check_erase(__it);
return { _M_erase(__it.base()), this };
}
2011-11-16 00:28:49 +01:00
iterator
erase(const_iterator __first, const_iterator __last)
{
__glibcxx_check_erase_range(__first, __last);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
for (auto __tmp = __first.base(); __tmp != __last.base(); ++__tmp)
debug.cc: Introduce a mutex pool in get_safe_base_mutex. 2010-11-25 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Introduce a mutex pool in get_safe_base_mutex. Move code used to manipulate sequence safe iterators from safe iterator methods to safe sequence ones. Remove usage of safe iterator mutex, keep _Safe_iterator_base::_M_get_mutex for library backward binary compatibility. * src/Makefile.am: Build debug.cc in gnu++0x mode for _Hash_impl usage. * src/Makefile.in: Regenerate * include/debug/safe_base.h: Add _Safe_iterator_base _M_invalidate and _M_reset. Add _Safe_sequence_base _M_attach, _M_attach_single, _M_detach and _M_detach_single. * include/debug.safe_iterator.h, safe_iterator.tcc: Remove _Safe_iterator _M_invalidate and _M_invalidate_single. Implement all methods in terms of normal iterators rather than safe ones. * include/debug/safe_sequence.h: Replace _Safe_sequence _M_transfe_iter with _M_transfer_from_if taking the source sequence and a predicate signaling when a safe iterator shall be transfered. Add _Equal_to predicate. * include/debug/safe_sequence.tcc: New. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/debug/forward_list: Swap safe iterators in move constructor. Do not invalidate before begin in _M_invalidate_all method. Reimplement safe methods using normal iterators rather than safe ones. * include/debug/set.h, unordered_map, multiset.h, vector, unordered_set, deque, map.h, list, multimap.h: Reimplement safe method using normal iterators rather than safe ones. * testsuite/23_containers/forward_list/debug/clear.cc, swap.cc, move_constructor.cc, splice_after.cc, splice_after1.cc, splice_after2.cc, splice_after3.cc, splice_after4.cc: New. * testsuite/23_containers/vector/debug/multithreaded_swap.cc: New. From-SVN: r167152
2010-11-25 21:53:39 +01:00
{
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
_GLIBCXX_DEBUG_VERIFY(__tmp != _Base::cend(),
debug.cc: Introduce a mutex pool in get_safe_base_mutex. 2010-11-25 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Introduce a mutex pool in get_safe_base_mutex. Move code used to manipulate sequence safe iterators from safe iterator methods to safe sequence ones. Remove usage of safe iterator mutex, keep _Safe_iterator_base::_M_get_mutex for library backward binary compatibility. * src/Makefile.am: Build debug.cc in gnu++0x mode for _Hash_impl usage. * src/Makefile.in: Regenerate * include/debug/safe_base.h: Add _Safe_iterator_base _M_invalidate and _M_reset. Add _Safe_sequence_base _M_attach, _M_attach_single, _M_detach and _M_detach_single. * include/debug.safe_iterator.h, safe_iterator.tcc: Remove _Safe_iterator _M_invalidate and _M_invalidate_single. Implement all methods in terms of normal iterators rather than safe ones. * include/debug/safe_sequence.h: Replace _Safe_sequence _M_transfe_iter with _M_transfer_from_if taking the source sequence and a predicate signaling when a safe iterator shall be transfered. Add _Equal_to predicate. * include/debug/safe_sequence.tcc: New. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/debug/forward_list: Swap safe iterators in move constructor. Do not invalidate before begin in _M_invalidate_all method. Reimplement safe methods using normal iterators rather than safe ones. * include/debug/set.h, unordered_map, multiset.h, vector, unordered_set, deque, map.h, list, multimap.h: Reimplement safe method using normal iterators rather than safe ones. * testsuite/23_containers/forward_list/debug/clear.cc, swap.cc, move_constructor.cc, splice_after.cc, splice_after1.cc, splice_after2.cc, splice_after3.cc, splice_after4.cc: New. * testsuite/23_containers/vector/debug/multithreaded_swap.cc: New. From-SVN: r167152
2010-11-25 21:53:39 +01:00
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
_M_invalidate(__tmp);
debug.cc: Introduce a mutex pool in get_safe_base_mutex. 2010-11-25 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Introduce a mutex pool in get_safe_base_mutex. Move code used to manipulate sequence safe iterators from safe iterator methods to safe sequence ones. Remove usage of safe iterator mutex, keep _Safe_iterator_base::_M_get_mutex for library backward binary compatibility. * src/Makefile.am: Build debug.cc in gnu++0x mode for _Hash_impl usage. * src/Makefile.in: Regenerate * include/debug/safe_base.h: Add _Safe_iterator_base _M_invalidate and _M_reset. Add _Safe_sequence_base _M_attach, _M_attach_single, _M_detach and _M_detach_single. * include/debug.safe_iterator.h, safe_iterator.tcc: Remove _Safe_iterator _M_invalidate and _M_invalidate_single. Implement all methods in terms of normal iterators rather than safe ones. * include/debug/safe_sequence.h: Replace _Safe_sequence _M_transfe_iter with _M_transfer_from_if taking the source sequence and a predicate signaling when a safe iterator shall be transfered. Add _Equal_to predicate. * include/debug/safe_sequence.tcc: New. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/debug/forward_list: Swap safe iterators in move constructor. Do not invalidate before begin in _M_invalidate_all method. Reimplement safe methods using normal iterators rather than safe ones. * include/debug/set.h, unordered_map, multiset.h, vector, unordered_set, deque, map.h, list, multimap.h: Reimplement safe method using normal iterators rather than safe ones. * testsuite/23_containers/forward_list/debug/clear.cc, swap.cc, move_constructor.cc, splice_after.cc, splice_after1.cc, splice_after2.cc, splice_after3.cc, splice_after4.cc: New. * testsuite/23_containers/vector/debug/multithreaded_swap.cc: New. From-SVN: r167152
2010-11-25 21:53:39 +01:00
}
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __next = _Base::erase(__first.base(), __last.base());
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __next, this };
}
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::rehash;
using _Base::reserve;
_Base&
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
_M_base() noexcept { return *this; }
const _Base&
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
_M_base() const noexcept { return *this; }
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
private:
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
void
_M_check_rehashed(size_type __prev_count)
{
if (__prev_count != this->bucket_count())
this->_M_invalidate_all();
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
}
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
void
_M_invalidate(_Base_const_iterator __victim)
{
this->_M_invalidate_if(
[__victim](_Base_const_iterator __it) { return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it == __victim; });
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
}
_Base_iterator
_M_erase(_Base_const_iterator __victim)
{
_M_invalidate(__victim);
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__victim);
_M_check_rehashed(__bucket_count);
return __next;
}
#if __cplusplus > 201402L
node_type
_M_extract(_Base_const_iterator __victim)
{
_M_invalidate(__victim);
return _Base::extract(__victim);
}
#endif
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
};
#if __cpp_deduction_guides >= 201606
template<typename _InputIterator,
typename _Hash = hash<__iter_key_t<_InputIterator>>,
typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map<int, int>::size_type = {},
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
_Hash, _Pred, _Allocator>;
template<typename _Key, typename _Tp, typename _Hash = hash<_Key>,
typename _Pred = equal_to<_Key>,
typename _Allocator = allocator<pair<const _Key, _Tp>>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>>
unordered_map(initializer_list<pair<_Key, _Tp>>,
typename unordered_map<int, int>::size_type = {},
_Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
-> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>;
template<typename _InputIterator, typename _Allocator,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map<int, int>::size_type, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>,
_Allocator>;
template<typename _InputIterator, typename _Allocator,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>,
_Allocator>;
template<typename _InputIterator, typename _Hash, typename _Allocator,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>>
unordered_map(_InputIterator, _InputIterator,
typename unordered_map<int, int>::size_type,
_Hash, _Allocator)
-> unordered_map<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template<typename _Key, typename _Tp, typename _Allocator,
typename = _RequireAllocator<_Allocator>>
unordered_map(initializer_list<pair<_Key, _Tp>>,
typename unordered_map<int, int>::size_type,
_Allocator)
-> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template<typename _Key, typename _Tp, typename _Allocator,
typename = _RequireAllocator<_Allocator>>
unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
-> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template<typename _Key, typename _Tp, typename _Hash, typename _Allocator,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>>
unordered_map(initializer_list<pair<_Key, _Tp>>,
typename unordered_map<int, int>::size_type,
_Hash, _Allocator)
-> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
#endif
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
inline void
swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/forward_list.h (forward_list::swap): Make noexcept unconditional. * include/bits/hashtable.h (_Hashtable::swap): Do not use _S_nothrow_swap(). * include/bits/stl_bvector.h (vector<bool>::swap): Make noexcept unconditional. * include/bits/stl_deque.h (deque::swap): Likewise. (swap(deque&, deque&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_list.h (list::swap): Make noexcept unconditional. (swap(list&, list&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_map.h (map::swap, swap(map&, map&)): Use _GLIBCXX_NOEXCEPT_IF, do not depend on _S_nothrow_swap. * include/bits/stl_multimap.h (multimap::swap, swap(multimap&, multimap&)): Likewise. * include/bits/stl_multiset.h (multiset::swap, swap(multiset&, multiset&)): Likewise. * include/bits/stl_set.h (set::swap, swap(set&, set&)): Likewise. * include/bits/stl_tree.h (_Rb_tree::swap, swap(_Rb_tree&, _Rb_tree&)): Likewise. * include/bits/stl_vector.h (vector::swap): Make noexcept unconditional. (swap(vector&, vector&)): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/deque (deque::swap, swap): Likewise. * include/debug/forward_list (swap): Add noexcept. * include/debug/list (list::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/map.h (map::swap, swap): Likewise. * include/debug/multimap.h (multimap::swap, swap): Likewise. * include/debug/multiset.h (multiset::Swap, swap): Likewise. * include/debug/set.h (set::swap, swap): Likewise. * include/debug/unordered_map (unordered_map::swap, unordered_multimap::swap, swap): Likewise. * include/debug/unordered_set (unordered_set::swap, unordered_multiset::swap, swap): Likewise. * include/debug/vector (vector::swap, swap): Likewise. * include/ext/alloc_traits.h (__alloc_traits::_S_nothrow_swap()): Remove. * include/profile/deque (deque::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/profile/forward_list (swap): Add noexcept. * include/profile/list (list::swap, swap) : Use _GLIBCXX_NOEXCEPT_IF. * include/profile/map.h (map::swap, swap): Likewise. * include/profile/multimap.h (multimap::swap, swap): Likewise. * include/profile/multiset.h (multiset::swap, swap): Likewise. * include/profile/set.h (set::swap, swap): Likewise. * include/profile/unordered_map (swap): Likewise. * include/profile/unordered_set (swap): Likewise. * include/profile/vector (vector::swap, swap): Likewise. Remove overloads for swapping rvalues. * testsuite/23_containers/deque/allocator/noexcept.cc: Update tests for noexcept on swap. * testsuite/23_containers/forward_list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/bool/allocator/noexcept.cc: Likewise. * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line number. From-SVN: r225744
2015-07-13 19:15:48 +02:00
noexcept(noexcept(__x.swap(__y)))
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
{ __x.swap(__y); }
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
inline bool
operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() == __y._M_base(); }
#if __cpp_impl_three_way_comparison < 201907L
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
inline bool
operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); }
#endif
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
/// Class std::unordered_multimap with safety/checking/debug instrumentation.
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
template<typename _Key, typename _Tp,
typename _Hash = std::hash<_Key>,
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
typename _Pred = std::equal_to<_Key>,
typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
class unordered_multimap
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
: public __gnu_debug::_Safe_container<
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>, _Alloc,
__gnu_debug::_Safe_unordered_container>,
public _GLIBCXX_STD_C::unordered_multimap<
_Key, _Tp, _Hash, _Pred, _Alloc>
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
{
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
_Pred, _Alloc> _Base;
typedef __gnu_debug::_Safe_container<unordered_multimap,
_Alloc, __gnu_debug::_Safe_unordered_container> _Safe;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
typedef typename _Base::const_local_iterator _Base_const_local_iterator;
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
typedef typename _Base::local_iterator _Base_local_iterator;
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
re PR libstdc++/68222 (_Safe_iterator provides operators the wrapped iterator can't actually support) 2018-08-22 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/68222 * include/debug/safe_iterator.h (_Safe_iterator<_It, _Sq, _Cat>): Add category template parameter. (_Safe_iterator<>::_Const_iterator): Remove. (_Safe_iterator<>::_IsConstant): New. (_Safe_iterator<>::_OtherIterator): New. (_Safe_iterator<_It, _Sq, _Cat>::_Safe_iterator<_MutIte>( const _Safe_iterator<_MutIte, _Sq, _Cat>&)): Add _IsConstant::__value in __gnu_cxx::__enable_if condition. (_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_to): New. (_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_from_begin): New. (_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_to_end): New. (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>): New. (_Safe_iterator<_It, _Sq, _Cat>::operator--()): Move... (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag> ::operator--()): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator--(int)): Move... (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag> ::operator--(int)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::_M_decrementable()): Move... (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag> ::_M_decrementable()): ...here. (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>): New. (_Safe_iterator<_It, _Sq, _Cat>::operator[](const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator[](const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator+=(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator+=(const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator+(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator+(const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator-=(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator-=(const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator-(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator-(const difference_type&)): ...here. (operator<(const _Safe_iterator<>&, const _Safe_iterator<>&)): Constraint to random access iterators. (operator<=(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator>(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator>=(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator-(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator+(const difference_type&, const _Safe_iterator<>&)): Likewise. (__check_dereferenceable(const _Safe_iterator<>&)): Remove. (__get_distance): Remove. (__get_distance_from_begin): Remove. (__get_distance_to_end): Remove. (struct __is_safe_random_iterator<_Safe_iterator<>>): Remove partial specialization. (__base(const _Safe_iterator<>&, std::input_iterator_tag)): Remove. (__base(const _Safe_iterator<>&, std::random_access_iterator_tag)): Remove. (__base(const _Safe_iterator<>&)): Constraint to random access iterator. * include/debug/safe_iterator.tcc (_Safe_iterator<>::_M_get_distance_from_begin()): New. (_Safe_iterator<>::_M_get_distance_to_end()): New. (_Safe_iterator<>::_M_get_distance_to(const _Safe_iterator<>&)): New. (_Safe_iterator<_It, _Seq, std::random_access_iterator_tag> ::_M_valid_range): New. * include/debug/safe_local_iterator.h (_Safe_local_iterator<>::_Const_local_iterator): Remove. (_Safe_local_iterator<>::_IsConstant): New. (_Safe_local_iterator<>::_OtherIterator): New. (_Safe_local_iterator<_It, _Cont>::_Safe_local_iterator<_MutIte, _Cont>( const _Safe_local_iterator<_MutIte, _Seq>&)): Add _IsConstant::__value in __gnu_cxx::__enable_if condition. If singular compare base iterator with _MutIte rather than _It. (_Safe_local_iterator<>::_S_constant): Make constexpr. (_Safe_local_iterator<>::_M_get_distance_to): New. (__check_dereferenceable(const _Safe_local_iterator<>&)): Remove. (__get_distance(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&, std::input_iterator_tag)): Remove. (__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&)): New. * include/debug/safe_local_iterator.tcc (_Safe_local_iterator<>::_M_get_distance_to): New. * include/debug/deque (std::__debug::deque<>): Add ::__gnu_debug::_Safe_iterator<> friend declaration. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise and add ::__gnu_debug::_Safe_local_iterator<> friend declaration. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/formatter.h: Adapt. * include/debug/helper_functions.h (__gnu_debug::_Safe_local_iterator<>): Add declaration. (__get_distance<_Ite>(_Ite, _Ite, std::random_access_iterator_tag): Pass parameter by copy. (__get_distance<_Ite>(_Ite, _Ite, std::input_iterator_tag): Likewise. (__get_distance<_Ite>(_Ite, _Ite): Likewise. (__valid_range_aux<_Integral>): Pass _Integral by copy. (__valid_range<_InputIterator>): Pass _InputIterator by copy. (__valid_range<>(const _Safe_iterator<>&, const _Safe_iterator<>&, typename _Distance_traits<>::__type&)): Declare. (__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&, typename _Distance_traits<>::__type&)): Declare. (__valid_range<>(const _Safe_iterator<>&, const _Safe_iterator<>&)): Declare. (__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&)): Declare. (__can_advance): Adapt. (struct __is_safe_random_iterator<>): Remove. (struct _SIter_base<>): Remove. * include/debug/functions.h: Include <bits/stl_iterator.h>. (__check_dereferenceable): Remove. (__foreign_iterator_aux4, __foreign_iterator_aux3): Adapt. (__foreign_iterator_aux2, __foreign_iterator_aux): Adapt. (__foreign_iterator): Adapt. * include/debug/stl_iterator.h (__is_safe_random_iterator<std::reverse_iterator<>>): Remove. (__base(const std::reverse_iterator<_Safe_iterator<_It, _Sq>)): Constraint for random access iterators. (__niter_base): Adapt. * testsuite/util/testsuite_containers.h: Include <bits/boost_concept_check.h>. (iterator_concept_checks<_It, _Mutable, _Category>): New. (citerator<_Cont>::forward_members::forward_members()): Instantiate latter for container iterator and const_iterator. * testsuite/23_containers/list/68222_neg.cc: New. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adapt line number. * testsuite/23_containers/unordered_set/debug/debug_functions.cc: (test01): Remove. * testsuite/23_containers/vector/debug/debug_functions.cc (test01): Remove. From-SVN: r263786
2018-08-22 20:51:25 +02:00
template<typename _ItT, typename _SeqT, typename _CatT>
friend class ::__gnu_debug::_Safe_iterator;
template<typename _ItT, typename _SeqT>
friend class ::__gnu_debug::_Safe_local_iterator;
libstdc++: Make debug containers prefer copy ctor to base ctor (PR 90102) When given a type which can convert to any container-like type, the C(const C&) copy constructor and C(const C::_Base&) converting constructor are ambiguous. This change replaces the converting constructor's parameter with a reference_wrapper-like type so that calling that constructor requires an additional user-defined conversion. This gives it a lower rank than the copy constructor, avoiding the ambiguity. While testing this change I discovered that __gnu_debug::forward_list doesn't have a convering constructor from the std::forward_list base, so this adds it. We should probably consider whether the converting constructors should be 'explicit' but I'm not changing that now. libstdc++-v3/ChangeLog: PR libstdc++/90102 * include/debug/deque (deque(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/forward_list (forward_list(_Base_ref)): New constructor. * include/debug/list (list(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/map.h (map(const _Base&)): Likewise. * include/debug/multimap.h (multimap(const _Base&)): Likewise. * include/debug/multiset.h (multiset(const _Base&)): Likewise. * include/debug/set.h (set(const _Base&)): Likewise. * include/debug/unordered_map (unordered_map(const _Base&)) (unordered_multimap(const _Base&)): Likewise. * include/debug/unordered_set (unordered_set(const _Base&)) (unordered_multiset(const _Base&)): Likewise. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adjust dg-error line number. * include/debug/vector (vector(const _Base&)): Likewise. * testsuite/23_containers/deque/debug/90102.cc: New test. * testsuite/23_containers/forward_list/debug/90102.cc: New test. * testsuite/23_containers/list/debug/90102.cc: New test. * testsuite/23_containers/map/debug/90102.cc: New test. * testsuite/23_containers/multimap/debug/90102.cc: New test. * testsuite/23_containers/multiset/debug/90102.cc: New test. * testsuite/23_containers/set/debug/90102.cc: New test. * testsuite/23_containers/unordered_map/debug/90102.cc: New test. * testsuite/23_containers/unordered_multimap/debug/90102.cc: New test. * testsuite/23_containers/unordered_multiset/debug/90102.cc: New test. * testsuite/23_containers/unordered_set/debug/90102.cc: New test. * testsuite/23_containers/vector/debug/90102.cc: New test.
2020-06-02 19:13:08 +02:00
// Reference wrapper for base class. See PR libstdc++/90102.
struct _Base_ref
{
_Base_ref(const _Base& __r) : _M_ref(__r) { }
const _Base& _M_ref;
};
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
public:
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
typedef typename _Base::key_type key_type;
typedef typename _Base::value_type value_type;
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
typedef typename _Base::mapped_type mapped_type;
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
typedef typename _Base::pointer pointer;
typedef typename _Base::const_pointer const_pointer;
typedef typename _Base::reference reference;
typedef typename _Base::const_reference const_reference;
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
typedef __gnu_debug::_Safe_iterator<
_Base_iterator, unordered_multimap> iterator;
typedef __gnu_debug::_Safe_iterator<
_Base_const_iterator, unordered_multimap> const_iterator;
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
typedef __gnu_debug::_Safe_local_iterator<
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
_Base_local_iterator, unordered_multimap> local_iterator;
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
typedef __gnu_debug::_Safe_local_iterator<
re PR libstdc++/68222 (_Safe_iterator provides operators the wrapped iterator can't actually support) 2018-08-22 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/68222 * include/debug/safe_iterator.h (_Safe_iterator<_It, _Sq, _Cat>): Add category template parameter. (_Safe_iterator<>::_Const_iterator): Remove. (_Safe_iterator<>::_IsConstant): New. (_Safe_iterator<>::_OtherIterator): New. (_Safe_iterator<_It, _Sq, _Cat>::_Safe_iterator<_MutIte>( const _Safe_iterator<_MutIte, _Sq, _Cat>&)): Add _IsConstant::__value in __gnu_cxx::__enable_if condition. (_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_to): New. (_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_from_begin): New. (_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_to_end): New. (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>): New. (_Safe_iterator<_It, _Sq, _Cat>::operator--()): Move... (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag> ::operator--()): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator--(int)): Move... (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag> ::operator--(int)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::_M_decrementable()): Move... (_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag> ::_M_decrementable()): ...here. (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>): New. (_Safe_iterator<_It, _Sq, _Cat>::operator[](const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator[](const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator+=(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator+=(const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator+(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator+(const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator-=(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator-=(const difference_type&)): ...here. (_Safe_iterator<_It, _Sq, _Cat>::operator-(const difference_type&)): Move... (_Safe_iterator<_It, _Sq, std::random_access_iterator_tag> ::operator-(const difference_type&)): ...here. (operator<(const _Safe_iterator<>&, const _Safe_iterator<>&)): Constraint to random access iterators. (operator<=(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator>(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator>=(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator-(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. (operator+(const difference_type&, const _Safe_iterator<>&)): Likewise. (__check_dereferenceable(const _Safe_iterator<>&)): Remove. (__get_distance): Remove. (__get_distance_from_begin): Remove. (__get_distance_to_end): Remove. (struct __is_safe_random_iterator<_Safe_iterator<>>): Remove partial specialization. (__base(const _Safe_iterator<>&, std::input_iterator_tag)): Remove. (__base(const _Safe_iterator<>&, std::random_access_iterator_tag)): Remove. (__base(const _Safe_iterator<>&)): Constraint to random access iterator. * include/debug/safe_iterator.tcc (_Safe_iterator<>::_M_get_distance_from_begin()): New. (_Safe_iterator<>::_M_get_distance_to_end()): New. (_Safe_iterator<>::_M_get_distance_to(const _Safe_iterator<>&)): New. (_Safe_iterator<_It, _Seq, std::random_access_iterator_tag> ::_M_valid_range): New. * include/debug/safe_local_iterator.h (_Safe_local_iterator<>::_Const_local_iterator): Remove. (_Safe_local_iterator<>::_IsConstant): New. (_Safe_local_iterator<>::_OtherIterator): New. (_Safe_local_iterator<_It, _Cont>::_Safe_local_iterator<_MutIte, _Cont>( const _Safe_local_iterator<_MutIte, _Seq>&)): Add _IsConstant::__value in __gnu_cxx::__enable_if condition. If singular compare base iterator with _MutIte rather than _It. (_Safe_local_iterator<>::_S_constant): Make constexpr. (_Safe_local_iterator<>::_M_get_distance_to): New. (__check_dereferenceable(const _Safe_local_iterator<>&)): Remove. (__get_distance(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&, std::input_iterator_tag)): Remove. (__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&)): New. * include/debug/safe_local_iterator.tcc (_Safe_local_iterator<>::_M_get_distance_to): New. * include/debug/deque (std::__debug::deque<>): Add ::__gnu_debug::_Safe_iterator<> friend declaration. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise and add ::__gnu_debug::_Safe_local_iterator<> friend declaration. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/formatter.h: Adapt. * include/debug/helper_functions.h (__gnu_debug::_Safe_local_iterator<>): Add declaration. (__get_distance<_Ite>(_Ite, _Ite, std::random_access_iterator_tag): Pass parameter by copy. (__get_distance<_Ite>(_Ite, _Ite, std::input_iterator_tag): Likewise. (__get_distance<_Ite>(_Ite, _Ite): Likewise. (__valid_range_aux<_Integral>): Pass _Integral by copy. (__valid_range<_InputIterator>): Pass _InputIterator by copy. (__valid_range<>(const _Safe_iterator<>&, const _Safe_iterator<>&, typename _Distance_traits<>::__type&)): Declare. (__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&, typename _Distance_traits<>::__type&)): Declare. (__valid_range<>(const _Safe_iterator<>&, const _Safe_iterator<>&)): Declare. (__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&)): Declare. (__can_advance): Adapt. (struct __is_safe_random_iterator<>): Remove. (struct _SIter_base<>): Remove. * include/debug/functions.h: Include <bits/stl_iterator.h>. (__check_dereferenceable): Remove. (__foreign_iterator_aux4, __foreign_iterator_aux3): Adapt. (__foreign_iterator_aux2, __foreign_iterator_aux): Adapt. (__foreign_iterator): Adapt. * include/debug/stl_iterator.h (__is_safe_random_iterator<std::reverse_iterator<>>): Remove. (__base(const std::reverse_iterator<_Safe_iterator<_It, _Sq>)): Constraint for random access iterators. (__niter_base): Adapt. * testsuite/util/testsuite_containers.h: Include <bits/boost_concept_check.h>. (iterator_concept_checks<_It, _Mutable, _Category>): New. (citerator<_Cont>::forward_members::forward_members()): Instantiate latter for container iterator and const_iterator. * testsuite/23_containers/list/68222_neg.cc: New. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adapt line number. * testsuite/23_containers/unordered_set/debug/debug_functions.cc: (test01): Remove. * testsuite/23_containers/vector/debug/debug_functions.cc (test01): Remove. From-SVN: r263786
2018-08-22 20:51:25 +02:00
_Base_const_local_iterator, unordered_multimap> const_local_iterator;
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
typedef typename _Base::difference_type difference_type;
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
unordered_multimap() = default;
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
explicit
unordered_multimap(size_type __n,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __eql, __a) { }
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
template<typename _InputIterator>
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
unordered_multimap(_InputIterator __first, _InputIterator __last,
hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. 2010-08-13 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. (operator=(_Hashtable&&)): Define. * include/bits/unordered_map.h (unordered_map(unordered_map&&), unordered_map(const unordered_map&), unordered_multimap (unordered_multimap&&), unordered_multimap(const unordered_multimap&), __unordered_map(__unordered_map&&), __unordered_map(const __unordered_map&), __unordered_multimap(__unordered_multimap&&), __unordered_multimap(const __unordered_multimap&)): Do not define, leave implicit. * include/bits/unordered_set.h (unordered_set(unordered_set&&), unordered_set(const unordered_set&), unordered_multiset (unordered_multiset&&), unordered_multiset(const unordered_multiset&), __unordered_set(__unordered_set&&), __unordered_set(const __unordered_set&), __unordered_multiset(__unordered_multiset&&), __unordered_multiset(const __unordered_multiset&)): Likewise. * include/bits/unordered_map.h (__unordered_map(initializer_list<>), __unordered_map<>::operator=(initializer_list<>), __unordered_multimap(initializer_list<>), __unordered_multimap<>:: operator=(initializer_list<>)): Add. * include/bits/unordered_set.h (__unordered_set(initializer_list<>), __unordered_set<>::operator=(initializer_list<>), __unordered_multiset(initializer_list<>), __unordered_multiset<>:: operator=(initializer_list<>)): Likewise. * include/bits/unordered_map.h (__unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Fix __n default to 0. * include/bits/unordered_set.h (__unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. From-SVN: r163236
2010-08-14 03:00:23 +02:00
size_type __n = 0,
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
macros.h (__glibcxx_check_valid_range_at): New. 2018-05-08 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h (__glibcxx_check_valid_range_at): New. * include/debug/functions.h (__check_valid_range): Use latter. * include/debug/macros.h (__glibcxx_check_valid_constructor_range): New, use latter. * include/debug/deque (deque::deque<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter. * include/debug/forward_list (forward_list::forward_list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/list (list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/list (list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/map.h (map::map<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (map::map<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/multimap.h (multimap::multimap<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (multimap::multimap<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/set.h (set::set<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (set::set<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/multiset.h (multiset::multiset<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (multiset::multiset<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)): Likewise. * include/debug/string (basic_string::basic_string<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/unordered_map (unordered_map::unordered_map<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (unordered_multimap::unordered_multimap<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/unordered_set (unordered_set::unordered_set<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. (unordered_multiset::unordered_multiset<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise. * include/debug/vector (vector::vector<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter. From-SVN: r260053
2018-05-08 21:46:59 +02:00
: _Base(__gnu_debug::__base(
__glibcxx_check_valid_constructor_range(__first, __last)),
[multiple changes] 2010-08-29 Paolo Carlini <paolo.carlini@oracle.com> * testsuite/23_containers/bitset/invalidation: Move... * testsuite/23_containers/bitset/debug/invalidation: ... here. * testsuite/23_containers/deque/invalidation: Move... * testsuite/23_containers/deque/debug/invalidation: ... here. * testsuite/23_containers/list/invalidation: Move... * testsuite/23_containers/list/debug/invalidation: ... here. * testsuite/23_containers/map/invalidation: Move... * testsuite/23_containers/map/debug/invalidation: ... here. * testsuite/23_containers/multimap/invalidation: Move... * testsuite/23_containers/multimap/debug/invalidation: ... here. * testsuite/23_containers/set/invalidation: Move... * testsuite/23_containers/set/debug/invalidation: ... here. * testsuite/23_containers/multiset/invalidation: Move... * testsuite/23_containers/multiset/debug/invalidation: ... here. * testsuite/23_containers/vector/invalidation: Move... * testsuite/23_containers/vector/debug/invalidation: ... here. 2010-08-29 François Dumont <francois.cppdevs@free.fr> * include/bits/stl_algobase.h (_Iter_base): Move... * include/bits/stl_iterator_base_types.h: ...here. * include/debug/functions.h (__check_valid_range, __check_string, __check_sorted): Fix to not depend on _GLIBCXX_DEBUG; include formatter.h and use formatting macros for a consistent debug result. * include/debug/formatter.h (__check_singular): Declare; do not include debug.h. * include/debug/debug.h: Do not include formatter.h. * include/debug/safe_iterator.h (_Safe_iterator::_Base_Iterator) rename to iterator_type. (__gnu_debug::__base): Add. * include/debug/set.h: Use everywhere __gnu_debug::__base once iterator range valided. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * testsuite/23_containers/util/debug/assign_neg.h: New test cases on debug checks performed on container assign operation. * testsuite/23_containers/util/debug/construct_neg.h: New test cases on debug checks on constructors. * testsuite/23_containers/util/debug/insert_neg.h: New test cases on debug checks performed on container insert operations. * testsuite/23_containers/unordered_map/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: New. * testsuite/23_containers/multimap/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/set/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/unordered_set/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/multiset/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/unordered_multiset/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/map/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/vector/debug/cont_traits.h, debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/deque/debug/cont_traits.h, debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/list/debug/cont_traits.h, debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/performance/23_containers/range_construct/ list_construct1.cc: New, validate performance impact of the patch on the debug mode. * testsuite/performance/23_containers/range_construct/ list_construct2.cc: Likewise. * testsuite/performance/23_containers/range_construct/ vector_construct.cc: Likewise. * testsuite/performance/23_containers/range_construct/ deque_construct.cc: Likewise. From-SVN: r163628
2010-08-29 19:39:00 +02:00
__gnu_debug::__base(__last), __n,
__hf, __eql, __a) { }
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
unordered_multimap(const unordered_multimap&) = default;
libstdc++: Make debug containers prefer copy ctor to base ctor (PR 90102) When given a type which can convert to any container-like type, the C(const C&) copy constructor and C(const C::_Base&) converting constructor are ambiguous. This change replaces the converting constructor's parameter with a reference_wrapper-like type so that calling that constructor requires an additional user-defined conversion. This gives it a lower rank than the copy constructor, avoiding the ambiguity. While testing this change I discovered that __gnu_debug::forward_list doesn't have a convering constructor from the std::forward_list base, so this adds it. We should probably consider whether the converting constructors should be 'explicit' but I'm not changing that now. libstdc++-v3/ChangeLog: PR libstdc++/90102 * include/debug/deque (deque(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/forward_list (forward_list(_Base_ref)): New constructor. * include/debug/list (list(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/map.h (map(const _Base&)): Likewise. * include/debug/multimap.h (multimap(const _Base&)): Likewise. * include/debug/multiset.h (multiset(const _Base&)): Likewise. * include/debug/set.h (set(const _Base&)): Likewise. * include/debug/unordered_map (unordered_map(const _Base&)) (unordered_multimap(const _Base&)): Likewise. * include/debug/unordered_set (unordered_set(const _Base&)) (unordered_multiset(const _Base&)): Likewise. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adjust dg-error line number. * include/debug/vector (vector(const _Base&)): Likewise. * testsuite/23_containers/deque/debug/90102.cc: New test. * testsuite/23_containers/forward_list/debug/90102.cc: New test. * testsuite/23_containers/list/debug/90102.cc: New test. * testsuite/23_containers/map/debug/90102.cc: New test. * testsuite/23_containers/multimap/debug/90102.cc: New test. * testsuite/23_containers/multiset/debug/90102.cc: New test. * testsuite/23_containers/set/debug/90102.cc: New test. * testsuite/23_containers/unordered_map/debug/90102.cc: New test. * testsuite/23_containers/unordered_multimap/debug/90102.cc: New test. * testsuite/23_containers/unordered_multiset/debug/90102.cc: New test. * testsuite/23_containers/unordered_set/debug/90102.cc: New test. * testsuite/23_containers/vector/debug/90102.cc: New test.
2020-06-02 19:13:08 +02:00
unordered_multimap(_Base_ref __x)
: _Base(__x._M_ref) { }
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
unordered_multimap(unordered_multimap&&) = default;
explicit
unordered_multimap(const allocator_type& __a)
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
: _Base(__a) { }
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
unordered_multimap(const unordered_multimap& __umap,
const allocator_type& __a)
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
: _Base(__umap, __a) { }
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
unordered_multimap(unordered_multimap&& __umap,
const allocator_type& __a)
libstdc++: [_GLIBCXX_DEBUG] Remove _Safe_container<>::_M_safe() _GLIBCXX_DEBUG container code cleanup to get rid of _Safe_container<>::_M_safe() and just use _Safe:: calls which use normal inheritance. Also remove several usages of _M_base() which can be most of the time ommitted and sometimes replace with explicit _Base:: calls. libstdc++-v3/ChangeLog: * include/debug/safe_container.h (_Safe_container<>::_M_safe): Remove. * include/debug/deque (deque::operator=(initializer_list<>)): Replace _M_base() call with _Base:: call. (deque::operator[](size_type)): Likewise. * include/debug/forward_list (forward_list(forward_list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (forward_list::operator=(initializer_list<>)): Remove _M_base() calls. (forward_list::splice_after, forward_list::merge): Likewise. * include/debug/list (list(list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (list::operator=(initializer_list<>)): Remove _M_base() calls. (list::splice, list::merge): Likewise. * include/debug/map.h (map(map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (map::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multimap.h (multimap(multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multimap::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/set.h (set(set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (set::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multiset.h (multiset(multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multiset::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/string (basic_string(basic_string&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (basic_string::operator=(initializer_list<>)): Remove _M_base() call. (basic_string::operator=(const _CharT*), basic_string::operator=(_CharT)): Likewise. (basic_string::operator[](size_type), basic_string::operator+=(const basic_string&)): Likewise. (basic_string::operator+=(const _Char*), basic_string::operator+=(_CharT)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_map::operator=(initializer_list<>), unordered_map::merge): Remove _M_base() calls. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multimap::operator=(initializer_list<>), unordered_multimap::merge): Remove _M_base() calls. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_set::operator=(initializer_list<>), unordered_set::merge): Remove _M_base() calls. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multiset::operator=(initializer_list<>), unordered_multiset::merge): Remove _M_base() calls. * include/debug/vector (vector(vector&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (vector::operator=(initializer_list<>)): Remove _M_base() calls. (vector::operator[](size_type)): Likewise.
2021-11-12 07:26:33 +01:00
noexcept( noexcept(_Base(std::move(__umap), __a)) )
: _Safe(std::move(__umap), __a),
_Base(std::move(__umap), __a) { }
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
unordered_multimap(initializer_list<value_type> __l,
hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. 2010-08-13 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. (operator=(_Hashtable&&)): Define. * include/bits/unordered_map.h (unordered_map(unordered_map&&), unordered_map(const unordered_map&), unordered_multimap (unordered_multimap&&), unordered_multimap(const unordered_multimap&), __unordered_map(__unordered_map&&), __unordered_map(const __unordered_map&), __unordered_multimap(__unordered_multimap&&), __unordered_multimap(const __unordered_multimap&)): Do not define, leave implicit. * include/bits/unordered_set.h (unordered_set(unordered_set&&), unordered_set(const unordered_set&), unordered_multiset (unordered_multiset&&), unordered_multiset(const unordered_multiset&), __unordered_set(__unordered_set&&), __unordered_set(const __unordered_set&), __unordered_multiset(__unordered_multiset&&), __unordered_multiset(const __unordered_multiset&)): Likewise. * include/bits/unordered_map.h (__unordered_map(initializer_list<>), __unordered_map<>::operator=(initializer_list<>), __unordered_multimap(initializer_list<>), __unordered_multimap<>:: operator=(initializer_list<>)): Add. * include/bits/unordered_set.h (__unordered_set(initializer_list<>), __unordered_set<>::operator=(initializer_list<>), __unordered_multiset(initializer_list<>), __unordered_multiset<>:: operator=(initializer_list<>)): Likewise. * include/bits/unordered_map.h (__unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Fix __n default to 0. * include/bits/unordered_set.h (__unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. From-SVN: r163236
2010-08-14 03:00:23 +02:00
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a) { }
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
unordered_multimap(size_type __n, const allocator_type& __a)
: unordered_multimap(__n, hasher(), key_equal(), __a)
{ }
unordered_multimap(size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_multimap(__n, __hf, key_equal(), __a)
{ }
template<typename _InputIterator>
unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n,
const allocator_type& __a)
libstdc++: Fix unordered containers move constructors noexcept qualification _Hashtable move constructor is wrongly qualified as noexcept(true) regardless of _Equal and _H1 copy constructor qualifications. _Hashtable allocator-aware move constructor is missing its noexcept qualification like the depending unordered containers ones. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type)): Add noexcept qualification. (_Hashtable(_Hashtable&&)): Fix noexcept qualification. (_Hashtable(_Hashtable&&, const allocator_type&)): Add noexcept qualification. * include/bits/unordered_map.h (unordered_map(unordered_map&&, const allocator_type&)): Add noexcept qualification. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/bits/unordered_set.h (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Likewise. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * testsuite/23_containers/unordered_map/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_map/modifiers/move_assign.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_set/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc: New test.
2020-01-20 19:15:43 +01:00
: unordered_multimap(__first, __last, __n, hasher(), key_equal(), __a)
{ }
template<typename _InputIterator>
unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf,
const allocator_type& __a)
libstdc++: Fix unordered containers move constructors noexcept qualification _Hashtable move constructor is wrongly qualified as noexcept(true) regardless of _Equal and _H1 copy constructor qualifications. _Hashtable allocator-aware move constructor is missing its noexcept qualification like the depending unordered containers ones. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type)): Add noexcept qualification. (_Hashtable(_Hashtable&&)): Fix noexcept qualification. (_Hashtable(_Hashtable&&, const allocator_type&)): Add noexcept qualification. * include/bits/unordered_map.h (unordered_map(unordered_map&&, const allocator_type&)): Add noexcept qualification. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/bits/unordered_set.h (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Likewise. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * testsuite/23_containers/unordered_map/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_map/modifiers/move_assign.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_set/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc: New test.
2020-01-20 19:15:43 +01:00
: unordered_multimap(__first, __last, __n, __hf, key_equal(), __a)
{ }
unordered_multimap(initializer_list<value_type> __l,
size_type __n,
const allocator_type& __a)
libstdc++: Fix unordered containers move constructors noexcept qualification _Hashtable move constructor is wrongly qualified as noexcept(true) regardless of _Equal and _H1 copy constructor qualifications. _Hashtable allocator-aware move constructor is missing its noexcept qualification like the depending unordered containers ones. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type)): Add noexcept qualification. (_Hashtable(_Hashtable&&)): Fix noexcept qualification. (_Hashtable(_Hashtable&&, const allocator_type&)): Add noexcept qualification. * include/bits/unordered_map.h (unordered_map(unordered_map&&, const allocator_type&)): Add noexcept qualification. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/bits/unordered_set.h (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Likewise. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * testsuite/23_containers/unordered_map/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_map/modifiers/move_assign.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_set/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc: New test.
2020-01-20 19:15:43 +01:00
: unordered_multimap(__l, __n, hasher(), key_equal(), __a)
{ }
unordered_multimap(initializer_list<value_type> __l,
size_type __n, const hasher& __hf,
const allocator_type& __a)
libstdc++: Fix unordered containers move constructors noexcept qualification _Hashtable move constructor is wrongly qualified as noexcept(true) regardless of _Equal and _H1 copy constructor qualifications. _Hashtable allocator-aware move constructor is missing its noexcept qualification like the depending unordered containers ones. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type)): Add noexcept qualification. (_Hashtable(_Hashtable&&)): Fix noexcept qualification. (_Hashtable(_Hashtable&&, const allocator_type&)): Add noexcept qualification. * include/bits/unordered_map.h (unordered_map(unordered_map&&, const allocator_type&)): Add noexcept qualification. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/bits/unordered_set.h (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Likewise. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Likewise. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Likewise. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Likewise. * testsuite/23_containers/unordered_map/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_map/modifiers/move_assign.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc: New test. * testsuite/23_containers/unordered_set/allocator/default_init.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_default_construct.cc: New test. * testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc: New test.
2020-01-20 19:15:43 +01:00
: unordered_multimap(__l, __n, __hf, key_equal(), __a)
{ }
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
~unordered_multimap() = default;
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. (_Hashtable<>::~_Hashtable): Use noexcept. * include/bits/stl_list.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use std::move on the allocator. (_Rb_tree<>::~_Rb_tree): Use noexcept. * include/bits/stl_deque.h: Likewise. * include/bits/basic_string.h (basic_string<>::~basic_string): Use noexcept. * include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise. * include/debug/set.h: Adjust. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/forward_list: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/ noexcept_move_construct.cc: New. * testsuite/21_strings/basic_string/cons/char/ noexcept_move_construct.cc: Likewise. * testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_map/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/forward_list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/bool/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/map/cons/noexcept_move_construct.cc * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * include/bits/move.h (swap): Use __and_ in the noexcept. * include/bits/algorithmfwd.h: Adjust. From-SVN: r174525
2011-06-01 16:16:19 +02:00
unordered_multimap&
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
operator=(const unordered_multimap&) = default;
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
unordered_multimap&
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
operator=(unordered_multimap&&) = default;
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
unordered_multimap&
operator=(initializer_list<value_type> __l)
{
libstdc++: [_GLIBCXX_DEBUG] Remove _Safe_container<>::_M_safe() _GLIBCXX_DEBUG container code cleanup to get rid of _Safe_container<>::_M_safe() and just use _Safe:: calls which use normal inheritance. Also remove several usages of _M_base() which can be most of the time ommitted and sometimes replace with explicit _Base:: calls. libstdc++-v3/ChangeLog: * include/debug/safe_container.h (_Safe_container<>::_M_safe): Remove. * include/debug/deque (deque::operator=(initializer_list<>)): Replace _M_base() call with _Base:: call. (deque::operator[](size_type)): Likewise. * include/debug/forward_list (forward_list(forward_list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (forward_list::operator=(initializer_list<>)): Remove _M_base() calls. (forward_list::splice_after, forward_list::merge): Likewise. * include/debug/list (list(list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (list::operator=(initializer_list<>)): Remove _M_base() calls. (list::splice, list::merge): Likewise. * include/debug/map.h (map(map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (map::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multimap.h (multimap(multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multimap::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/set.h (set(set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (set::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multiset.h (multiset(multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multiset::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/string (basic_string(basic_string&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (basic_string::operator=(initializer_list<>)): Remove _M_base() call. (basic_string::operator=(const _CharT*), basic_string::operator=(_CharT)): Likewise. (basic_string::operator[](size_type), basic_string::operator+=(const basic_string&)): Likewise. (basic_string::operator+=(const _Char*), basic_string::operator+=(_CharT)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_map::operator=(initializer_list<>), unordered_map::merge): Remove _M_base() calls. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multimap::operator=(initializer_list<>), unordered_multimap::merge): Remove _M_base() calls. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_set::operator=(initializer_list<>), unordered_set::merge): Remove _M_base() calls. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multiset::operator=(initializer_list<>), unordered_multiset::merge): Remove _M_base() calls. * include/debug/vector (vector(vector&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (vector::operator=(initializer_list<>)): Remove _M_base() calls. (vector::operator[](size_type)): Likewise.
2021-11-12 07:26:33 +01:00
_Base::operator=(__l);
hashtable_policy.h: Add C++11 allocator support. 2013-04-22 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h: Add C++11 allocator support. * include/bits/hashtable.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. * include/std/unordered_set: Remove bits/algobase.h include. Replace bits/alloc_traits.h by ext/alloc_traits.h. * include/std/unordered_map: Likewise. * include/ext/throw_allocator.h: Add checks on calls to allocator construct/destroy. (std::hash<__gnu_cxx::throw_value_limit>): Add conditional throw. (std::hash<__gnu_cxx::throw_value_random>): Likewise. * testsuite/util/regression/rand/priority_queue /container_rand_regression_test.tcc: Adapt. * testsuite/util/regression/rand/assoc /container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_counter_type.h: Add count of destructors. * testsuite/23_containers/unordered_set /not_default_constructible_hash_neg.cc: Adjust dg-error line number. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: New. * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/minimal.cc: New. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_set/allocator/swap.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New. * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New. * testsuite/23_containers/unordered_map/allocator/copy.cc: New. * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/minimal.cc: New. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_map/allocator/swap.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New. * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: New. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New. * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New. From-SVN: r198158
2013-04-22 22:22:07 +02:00
this->_M_invalidate_all();
return *this;
}
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::get_allocator;
using _Base::empty;
using _Base::size;
using _Base::max_size;
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
void
stl_pair.h (swap): Do not swap rvalues. 2009-05-18 Jonathan Wakely <jwakely.gcc@gmail.com> * include/bits/stl_pair.h (swap): Do not swap rvalues. * include/bits/stl_deque.h (swap): Likewise. * include/bits/stl_list.h (swap): Likewise. * include/bits/stl_vector.h (swap): Likewise. * include/bits/stl_bvector.h (swap): Likewise. * include/bits/stl_queue.h (swap): Likewise. * include/bits/stl_stack.h (swap): Likewise. * include/bits/stl_tree.h (swap): Likewise. * include/bits/stl_map.h (swap): Likewise. * include/bits/stl_multimap.h (swap): Likewise. * include/bits/stl_set.h (swap): Likewise. * include/bits/stl_multiset.h (swap): Likewise. * include/bits/forward_list.h (swap): Likewise. * include/bits/unique_ptr.h (swap): Likewise. * include/debug/deque (swap): Likewise. * include/debug/list (swap): Likewise. * include/debug/vector (swap): Likewise. * include/debug/map.h (swap): Likewise. * include/debug/multimap.h (swap): Likewise. * include/debug/set.h (swap): Likewise. * include/debug/multiset.h (swap): Likewise. * include/debug/unordered_map (swap): Likewise. * include/debug/unordered_set (swap): Likewise. * include/ext/vstring.h (swap): Likewise. * include/tr1_impl/unordered_map (swap): Likewise. * include/tr1_impl/hashtable (swap): Likewise. * include/tr1_impl/unordered_set (swap): Likewise. * include/std/tuple (swap): Likewise. * include/std/mutex (swap): Likewise. * include/std/thread (swap): Likewise. (operator<<): Only output to lvalue streams. * testsuite/20_util/shared_ptr/modifiers/swap_rvalue.cc: Remove. * testsuite/23_containers/headers/forward_list/synopsis.cc: Adjust. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Adjust line numbers. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/30_threads/thread/swap/1.cc: Swap with lvalue and also test non-member swap. * testsuite/30_threads/thread/swap/2.cc: Remove. From-SVN: r147678
2009-05-19 00:15:56 +02:00
swap(unordered_multimap& __x)
c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/forward_list.h (forward_list::swap): Make noexcept unconditional. * include/bits/hashtable.h (_Hashtable::swap): Do not use _S_nothrow_swap(). * include/bits/stl_bvector.h (vector<bool>::swap): Make noexcept unconditional. * include/bits/stl_deque.h (deque::swap): Likewise. (swap(deque&, deque&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_list.h (list::swap): Make noexcept unconditional. (swap(list&, list&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_map.h (map::swap, swap(map&, map&)): Use _GLIBCXX_NOEXCEPT_IF, do not depend on _S_nothrow_swap. * include/bits/stl_multimap.h (multimap::swap, swap(multimap&, multimap&)): Likewise. * include/bits/stl_multiset.h (multiset::swap, swap(multiset&, multiset&)): Likewise. * include/bits/stl_set.h (set::swap, swap(set&, set&)): Likewise. * include/bits/stl_tree.h (_Rb_tree::swap, swap(_Rb_tree&, _Rb_tree&)): Likewise. * include/bits/stl_vector.h (vector::swap): Make noexcept unconditional. (swap(vector&, vector&)): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/deque (deque::swap, swap): Likewise. * include/debug/forward_list (swap): Add noexcept. * include/debug/list (list::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/map.h (map::swap, swap): Likewise. * include/debug/multimap.h (multimap::swap, swap): Likewise. * include/debug/multiset.h (multiset::Swap, swap): Likewise. * include/debug/set.h (set::swap, swap): Likewise. * include/debug/unordered_map (unordered_map::swap, unordered_multimap::swap, swap): Likewise. * include/debug/unordered_set (unordered_set::swap, unordered_multiset::swap, swap): Likewise. * include/debug/vector (vector::swap, swap): Likewise. * include/ext/alloc_traits.h (__alloc_traits::_S_nothrow_swap()): Remove. * include/profile/deque (deque::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/profile/forward_list (swap): Add noexcept. * include/profile/list (list::swap, swap) : Use _GLIBCXX_NOEXCEPT_IF. * include/profile/map.h (map::swap, swap): Likewise. * include/profile/multimap.h (multimap::swap, swap): Likewise. * include/profile/multiset.h (multiset::swap, swap): Likewise. * include/profile/set.h (set::swap, swap): Likewise. * include/profile/unordered_map (swap): Likewise. * include/profile/unordered_set (swap): Likewise. * include/profile/vector (vector::swap, swap): Likewise. Remove overloads for swapping rvalues. * testsuite/23_containers/deque/allocator/noexcept.cc: Update tests for noexcept on swap. * testsuite/23_containers/forward_list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/bool/allocator/noexcept.cc: Likewise. * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line number. From-SVN: r225744
2015-07-13 19:15:48 +02:00
noexcept( noexcept(declval<_Base&>().swap(__x)) )
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
{
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
_Safe::_M_swap(__x);
_Base::swap(__x);
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
}
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
void
clear() noexcept
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
{
_Base::clear();
this->_M_invalidate_all();
}
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
iterator
begin() noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::begin(), this }; }
const_iterator
begin() const noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::begin(), this }; }
iterator
end() noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::end(), this }; }
const_iterator
end() const noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::end(), this }; }
const_iterator
cbegin() const noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::cbegin(), this }; }
const_iterator
cend() const noexcept
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::cend(), this }; }
// local versions
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
local_iterator
begin(size_type __b)
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::begin(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
local_iterator
end(size_type __b)
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::end(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
const_local_iterator
begin(size_type __b) const
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::begin(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
const_local_iterator
end(size_type __b) const
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::end(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
const_local_iterator
cbegin(size_type __b) const
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::cbegin(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
const_local_iterator
cend(size_type __b) const
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
{
__glibcxx_check_bucket_index(__b);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::cend(__b), this };
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
}
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::bucket_count;
using _Base::max_bucket_count;
using _Base::bucket;
formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. 2012-10-16 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (_Debug_msg_id): Add __msg_bucket_index_oob. * include/debug/macros.h (__glibcxx_check_bucket_index): New. * include/debug/unordered_set (unordered_set<>::begin(size_type)): Add check on bucket index. (unordered_set<>::begin(size_type) const): Likewise. (unordered_set<>::cbegin(size_type) const): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::end(size_type) const): Likewise. (unordered_set<>::cend(size_type) const): Likewise. (unordered_set<>::bucket_size(size_type)): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::begin(size_type) const): Likewise. (unordered_multiset<>::cbegin(size_type) const): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::end(size_type) const): Likewise. (unordered_multiset<>::cend(size_type) const): Likewise. (unordered_multiset<>::bucket_size(size_type)): Likewise. * include/debug/unordered_map (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::begin(size_type) const): Likewise. (unordered_map<>::cbegin(size_type) const): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::end(size_type) const): Likewise. (unordered_map<>::cend(size_type) const): Likewise. (unordered_map<>::bucket_size(size_type)): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::begin(size_type) const): Likewise. (unordered_multimap<>::cbegin(size_type) const): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::end(size_type) const): Likewise. (unordered_multimap<>::cend(size_type) const): Likewise. (unordered_multimap<>::bucket_size(size_type)): Likewise. * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New. From-SVN: r192512
2012-10-16 21:57:03 +02:00
size_type
bucket_size(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
return _Base::bucket_size(__b);
}
float
max_load_factor() const noexcept
{ return _Base::max_load_factor(); }
void
max_load_factor(float __f)
{
__glibcxx_check_max_load_factor(__f);
_Base::max_load_factor(__f);
}
template<typename... _Args>
iterator
emplace(_Args&&... __args)
{
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __it = _Base::emplace(std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
}
template<typename... _Args>
iterator
emplace_hint(const_iterator __hint, _Args&&... __args)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __it = _Base::emplace_hint(__hint.base(),
std::forward<_Args>(__args)...);
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
}
iterator
insert(const value_type& __obj)
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
{
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __it = _Base::insert(__obj);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(value_type&& __x)
{
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(std::move(__x));
_M_check_rehashed(__bucket_count);
return { __it, this };
}
iterator
insert(const_iterator __hint, const value_type& __obj)
{
__glibcxx_check_insert(__hint);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __it = _Base::insert(__hint.base(), __obj);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2354. Unnecessary copying when inserting into maps with braced-init
iterator
insert(const_iterator __hint, value_type&& __x)
{
__glibcxx_check_insert(__hint);
size_type __bucket_count = this->bucket_count();
auto __it = _Base::insert(__hint.base(), std::move(__x));
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
}
2010-10-28 18:01:05 +02:00
template<typename _Pair, typename = typename
std::enable_if<std::is_constructible<value_type,
_Pair&&>::value>::type>
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
iterator
insert(_Pair&& __obj)
{
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __it = _Base::insert(std::forward<_Pair>(__obj));
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
}
2010-10-28 18:01:05 +02:00
template<typename _Pair, typename = typename
std::enable_if<std::is_constructible<value_type,
_Pair&&>::value>::type>
debug.cc: Introduce a mutex pool in get_safe_base_mutex. 2010-11-25 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Introduce a mutex pool in get_safe_base_mutex. Move code used to manipulate sequence safe iterators from safe iterator methods to safe sequence ones. Remove usage of safe iterator mutex, keep _Safe_iterator_base::_M_get_mutex for library backward binary compatibility. * src/Makefile.am: Build debug.cc in gnu++0x mode for _Hash_impl usage. * src/Makefile.in: Regenerate * include/debug/safe_base.h: Add _Safe_iterator_base _M_invalidate and _M_reset. Add _Safe_sequence_base _M_attach, _M_attach_single, _M_detach and _M_detach_single. * include/debug.safe_iterator.h, safe_iterator.tcc: Remove _Safe_iterator _M_invalidate and _M_invalidate_single. Implement all methods in terms of normal iterators rather than safe ones. * include/debug/safe_sequence.h: Replace _Safe_sequence _M_transfe_iter with _M_transfer_from_if taking the source sequence and a predicate signaling when a safe iterator shall be transfered. Add _Equal_to predicate. * include/debug/safe_sequence.tcc: New. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/debug/forward_list: Swap safe iterators in move constructor. Do not invalidate before begin in _M_invalidate_all method. Reimplement safe methods using normal iterators rather than safe ones. * include/debug/set.h, unordered_map, multiset.h, vector, unordered_set, deque, map.h, list, multimap.h: Reimplement safe method using normal iterators rather than safe ones. * testsuite/23_containers/forward_list/debug/clear.cc, swap.cc, move_constructor.cc, splice_after.cc, splice_after1.cc, splice_after2.cc, splice_after3.cc, splice_after4.cc: New. * testsuite/23_containers/vector/debug/multithreaded_swap.cc: New. From-SVN: r167152
2010-11-25 21:53:39 +01:00
iterator
insert(const_iterator __hint, _Pair&& __obj)
{
__glibcxx_check_insert(__hint);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __it = _Base::insert(__hint.base(), std::forward<_Pair>(__obj));
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __it, this };
}
2010-10-28 18:01:05 +02:00
void
insert(std::initializer_list<value_type> __l)
{ _Base::insert(__l); }
template<typename _InputIterator>
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
void
insert(_InputIterator __first, _InputIterator __last)
{
stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. 2015-06-29 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. * include/debug/functions.h (__gnu_debug::__valid_range, __gnu_debug::__base): Move... * include/debug/safe_iterator.h (__gnu_debug::_Sequence_traits): New. (__gnu_debug::__get_distance_from_begin): New. (__gnu_debug::__get_distance_to_end): New. (__gnu_debug::_Safe_iterator<>::_M_valid_range): Expose iterator range distance information. Add optional check_dereferenceable parameter, default true. (__gnu_debug::_Distance_precision, __gnu_debug::__get_distance): Move default definition... (__gnu_debug::__get_distance): New overload for _Safe_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/helper_functions.h: ...here. New. (__gnu_debug::__unsafe): New helper function to remove safe iterator layer. * include/debug/stl_iterator.h: New. Include latter. * include/bits/stl_iterator.h: Include latter in debug mode. * include/debug/stl_iterator.tcc: Adapt. * include/debug/safe_local_iterator.h (__gnu_debug::__get_distance): Add overload for _Safe_local_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/safe_local_iterator.tcc: Adapt. * include/debug/macros.h (__glibcxx_check_valid_range2): New. (__glibcxx_check_insert_range): Add _Dist parameter. (__glibcxx_check_insert_range_after): Likewise. (__glibcxx_check_string, __glibcxx_check_string_len): Implement using _GLIBCXX_DEBUG_PEDASSERT. * include/debug/deque (deque<>::assign): Remove iterator debug layer when possible. (deque<>::insert): Likewise. * include/debug/forward_list (__glibcxx_check_valid_fl_range): New. (forward_list<>::splice_after): Use latter. (forward_list<>::assign): Remove iterator debug layer when possible. (forward_list<>::insert_after): Likewise. (__gnu_debug::_Sequence_traits<>): Partial specialization. * include/debug/list (list<>::assign): Remove iterator debug layer when possible. (list<>::insert): Likewise. [__gnu_debug::_Sequence_traits<>]: Partial specialization pre C++11 ABI. * include/debug/map.h (map<>::insert): Remove iterator debug layer when possible. * include/debug/multimap.h (multimap<>::insert): Likewise. * include/debug/set.h (set<>::insert): Likewise. * include/debug/multiset.h (multiset<>::insert): Likewise. * include/debug/string (basic_string<>::append, basic_string<>::assign, basic_string<>::insert, basic_string<>::replace): Likewise. * include/debug/unordered_map (unordered_map<>::insert, unordered_multimap<>::insert): Likewise. * include/debug/unordered_set (unordered_set<>::insert, unordered_multiset<>insert): Likewise. * include/debug/vector (vector<>::assign, vector<>::insert): Likewise. * include/Makefile.am: Add new debug headers. * include/Makefile.in: Regenerate. From-SVN: r225143
2015-06-29 22:17:56 +02:00
typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
__glibcxx_check_valid_range2(__first, __last, __dist);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
size_type __bucket_count = this->bucket_count();
stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. 2015-06-29 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode. * include/debug/functions.h (__gnu_debug::__valid_range, __gnu_debug::__base): Move... * include/debug/safe_iterator.h (__gnu_debug::_Sequence_traits): New. (__gnu_debug::__get_distance_from_begin): New. (__gnu_debug::__get_distance_to_end): New. (__gnu_debug::_Safe_iterator<>::_M_valid_range): Expose iterator range distance information. Add optional check_dereferenceable parameter, default true. (__gnu_debug::_Distance_precision, __gnu_debug::__get_distance): Move default definition... (__gnu_debug::__get_distance): New overload for _Safe_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/helper_functions.h: ...here. New. (__gnu_debug::__unsafe): New helper function to remove safe iterator layer. * include/debug/stl_iterator.h: New. Include latter. * include/bits/stl_iterator.h: Include latter in debug mode. * include/debug/stl_iterator.tcc: Adapt. * include/debug/safe_local_iterator.h (__gnu_debug::__get_distance): Add overload for _Safe_local_iterator. (__gnu_debug::__unsafe): Likewise. * include/debug/safe_local_iterator.tcc: Adapt. * include/debug/macros.h (__glibcxx_check_valid_range2): New. (__glibcxx_check_insert_range): Add _Dist parameter. (__glibcxx_check_insert_range_after): Likewise. (__glibcxx_check_string, __glibcxx_check_string_len): Implement using _GLIBCXX_DEBUG_PEDASSERT. * include/debug/deque (deque<>::assign): Remove iterator debug layer when possible. (deque<>::insert): Likewise. * include/debug/forward_list (__glibcxx_check_valid_fl_range): New. (forward_list<>::splice_after): Use latter. (forward_list<>::assign): Remove iterator debug layer when possible. (forward_list<>::insert_after): Likewise. (__gnu_debug::_Sequence_traits<>): Partial specialization. * include/debug/list (list<>::assign): Remove iterator debug layer when possible. (list<>::insert): Likewise. [__gnu_debug::_Sequence_traits<>]: Partial specialization pre C++11 ABI. * include/debug/map.h (map<>::insert): Remove iterator debug layer when possible. * include/debug/multimap.h (multimap<>::insert): Likewise. * include/debug/set.h (set<>::insert): Likewise. * include/debug/multiset.h (multiset<>::insert): Likewise. * include/debug/string (basic_string<>::append, basic_string<>::assign, basic_string<>::insert, basic_string<>::replace): Likewise. * include/debug/unordered_map (unordered_map<>::insert, unordered_multimap<>::insert): Likewise. * include/debug/unordered_set (unordered_set<>::insert, unordered_multiset<>insert): Likewise. * include/debug/vector (vector<>::assign, vector<>::insert): Likewise. * include/Makefile.am: Add new debug headers. * include/Makefile.in: Regenerate. From-SVN: r225143
2015-06-29 22:17:56 +02:00
if (__dist.second >= __gnu_debug::__dp_sign)
_Base::insert(__gnu_debug::__unsafe(__first),
__gnu_debug::__unsafe(__last));
else
_Base::insert(__first, __last);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
}
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
#if __cplusplus > 201402L
using node_type = typename _Base::node_type;
node_type
extract(const_iterator __position)
{
__glibcxx_check_erase(__position);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return _M_extract(__position.base());
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
}
node_type
extract(const key_type& __key)
{
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
const auto __position = _Base::find(__key);
if (__position != _Base::end())
return _M_extract(__position);
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
return {};
}
iterator
insert(node_type&& __nh)
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::insert(std::move(__nh)), this }; }
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
iterator
insert(const_iterator __hint, node_type&& __nh)
{
__glibcxx_check_insert(__hint);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _Base::insert(__hint.base(), std::move(__nh)), this };
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
}
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
template<typename _H2, typename _P2>
void
merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
{
auto __guard
= _Safe::_S_umc_guard(std::__detail::_Select1st{}, __source);
libstdc++: [_GLIBCXX_DEBUG] Remove _Safe_container<>::_M_safe() _GLIBCXX_DEBUG container code cleanup to get rid of _Safe_container<>::_M_safe() and just use _Safe:: calls which use normal inheritance. Also remove several usages of _M_base() which can be most of the time ommitted and sometimes replace with explicit _Base:: calls. libstdc++-v3/ChangeLog: * include/debug/safe_container.h (_Safe_container<>::_M_safe): Remove. * include/debug/deque (deque::operator=(initializer_list<>)): Replace _M_base() call with _Base:: call. (deque::operator[](size_type)): Likewise. * include/debug/forward_list (forward_list(forward_list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (forward_list::operator=(initializer_list<>)): Remove _M_base() calls. (forward_list::splice_after, forward_list::merge): Likewise. * include/debug/list (list(list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (list::operator=(initializer_list<>)): Remove _M_base() calls. (list::splice, list::merge): Likewise. * include/debug/map.h (map(map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (map::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multimap.h (multimap(multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multimap::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/set.h (set(set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (set::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multiset.h (multiset(multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multiset::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/string (basic_string(basic_string&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (basic_string::operator=(initializer_list<>)): Remove _M_base() call. (basic_string::operator=(const _CharT*), basic_string::operator=(_CharT)): Likewise. (basic_string::operator[](size_type), basic_string::operator+=(const basic_string&)): Likewise. (basic_string::operator+=(const _Char*), basic_string::operator+=(_CharT)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_map::operator=(initializer_list<>), unordered_map::merge): Remove _M_base() calls. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multimap::operator=(initializer_list<>), unordered_multimap::merge): Remove _M_base() calls. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_set::operator=(initializer_list<>), unordered_set::merge): Remove _M_base() calls. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multiset::operator=(initializer_list<>), unordered_multiset::merge): Remove _M_base() calls. * include/debug/vector (vector(vector&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (vector::operator=(initializer_list<>)): Remove _M_base() calls. (vector::operator[](size_type)): Likewise.
2021-11-12 07:26:33 +01:00
_Base::merge(__source);
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
}
template<typename _H2, typename _P2>
void
merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
{ merge(__source); }
template<typename _H2, typename _P2>
void
merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source)
{
auto __guard
= _Safe::_S_uc_guard(std::__detail::_Select1st{}, __source);
libstdc++: [_GLIBCXX_DEBUG] Remove _Safe_container<>::_M_safe() _GLIBCXX_DEBUG container code cleanup to get rid of _Safe_container<>::_M_safe() and just use _Safe:: calls which use normal inheritance. Also remove several usages of _M_base() which can be most of the time ommitted and sometimes replace with explicit _Base:: calls. libstdc++-v3/ChangeLog: * include/debug/safe_container.h (_Safe_container<>::_M_safe): Remove. * include/debug/deque (deque::operator=(initializer_list<>)): Replace _M_base() call with _Base:: call. (deque::operator[](size_type)): Likewise. * include/debug/forward_list (forward_list(forward_list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (forward_list::operator=(initializer_list<>)): Remove _M_base() calls. (forward_list::splice_after, forward_list::merge): Likewise. * include/debug/list (list(list&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (list::operator=(initializer_list<>)): Remove _M_base() calls. (list::splice, list::merge): Likewise. * include/debug/map.h (map(map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (map::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multimap.h (multimap(multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multimap::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/set.h (set(set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (set::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/multiset.h (multiset(multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (multiset::operator=(initializer_list<>)): Remove _M_base() calls. * include/debug/string (basic_string(basic_string&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (basic_string::operator=(initializer_list<>)): Remove _M_base() call. (basic_string::operator=(const _CharT*), basic_string::operator=(_CharT)): Likewise. (basic_string::operator[](size_type), basic_string::operator+=(const basic_string&)): Likewise. (basic_string::operator+=(const _Char*), basic_string::operator+=(_CharT)): Likewise. * include/debug/unordered_map (unordered_map(unordered_map&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_map::operator=(initializer_list<>), unordered_map::merge): Remove _M_base() calls. (unordered_multimap(unordered_multimap&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multimap::operator=(initializer_list<>), unordered_multimap::merge): Remove _M_base() calls. * include/debug/unordered_set (unordered_set(unordered_set&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_set::operator=(initializer_list<>), unordered_set::merge): Remove _M_base() calls. (unordered_multiset(unordered_multiset&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (unordered_multiset::operator=(initializer_list<>), unordered_multiset::merge): Remove _M_base() calls. * include/debug/vector (vector(vector&&, const allocator_type&)): Remove _M_safe() and _M_base() calls. (vector::operator=(initializer_list<>)): Remove _M_base() calls. (vector::operator[](size_type)): Likewise.
2021-11-12 07:26:33 +01:00
_Base::merge(__source);
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
}
template<typename _H2, typename _P2>
void
merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
{ merge(__source); }
Implement C++17 node extraction and insertion (P0083R5) * doc/xml/manual/status_cxx2017.xml: Document status. * doc/html/*: Regenerate. * include/Makefile.am: Add bits/node_handle.h and reorder. * include/Makefile.in: Regenerate. * include/bits/hashtable.h (_Hashtable::node_type) (_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node) (_Hashtable::_M_reinsert_node_multi, _Hashtable::extract) (_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define. (_Hash_merge_helper): Define primary template. * include/bits/node_handle.h: New header. * include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as friend. (map::node_type, map::insert_return_type, map::extract, map::merge) (map::insert(node_type&&), map::insert(const_iterator, node_type&&)): Define new members. (_Rb_tree_merge_helper): Specialize for map. * include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper as friend. (multimap::node_type, multimap::extract, multimap::merge) (multimap::insert(node_type&&)) (multimap::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for multimap. * include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper as friend. (multiset::node_type, multiset::extract, multiset::merge) (multiset::insert(node_type&&)) (multiset::insert(const_iterator, node_type&&)): Define. * include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as friend. (set::node_type, set::insert_return_type, set::extract, set::merge) (set::insert(node_type&&), set::insert(const_iterator, node_type&&)): Define. (_Rb_tree_merge_helper): Specialize for set. * include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend. (_Rb_tree::node_type, _Rb_tree::insert_return_type) (_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal) (_Rb_tree::_M_reinsert_node_hint_unique) (_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract) (_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define. (_Rb_tree_merge_helper): Specialize for multiset. * include/bits/unordered_map.h (unordered_map): Declare unordered_map<> and unordered_multimap<> as friends. (unordered_map::node_type, unordered_map::insert_return_type) (unordered_map::extract, unordered_map::merge) (unordered_map::insert(node_type&&)) (unordered_map::insert(const_iterator, node_type&&)) (unordered_multimap): Declare _Hash_merge_helper as friend. (unordered_multimap::node_type, unordered_multimap::extract) (unordered_multimap::merge, unordered_multimap::insert(node_type&&)) (unordered_multimap::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered maps and multimaps. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Declare _Hash_merge_helper as friend. (unordered_set::node_type, unordered_set::insert_return_type) (unordered_set::extract, unordered_set::merge) (unordered_set::insert(node_type&&)) (unordered_set::insert(const_iterator, node_type&&)): Define. (unordered_multiset::node_type, unordered_multiset::extract) (unordered_multiset::merge, unordered_multiset::insert(node_type&&)) (unordered_multiset::insert(const_iterator, node_type&&)): Define. (_Hash_merge_helper): Specialize for unordered sets and multisets. * include/debug/map.h (map): Add using declarations or forwarding functions for new members. * include/debug/map.h (multimap): Likewise. * include/debug/map.h (multiset): Likewise. * include/debug/map.h (set): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set( unordered_set, unordered_multiset): Likewise. * python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New helper function. (get_value_from_list_node, get_value_from_Rb_tree_node): Use helper. (StdNodeHandlePrinter): Define printer for node handles. (build_libstdcxx_dictionary): Register StdNodeHandlePrinter. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/map/modifiers/merge.cc: New. * testsuite/23_containers/multimap/modifiers/extract.cc: New. * testsuite/23_containers/multimap/modifiers/merge.cc: New. * testsuite/23_containers/multiset/modifiers/extract.cc: New. * testsuite/23_containers/multiset/modifiers/merge.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/extract.cc: New. * testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/merge.cc: New. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error lineno. * testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles. From-SVN: r240363
2016-09-22 15:58:49 +02:00
#endif // C++17
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::hash_function;
using _Base::key_eq;
iterator
find(const key_type& __key)
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::find(__key), this }; }
libstdc++: Add unordered containers heterogeneous lookup Add unordered containers heterogeneous lookup member functions find, count, contains and equal_range in C++20. Those members are considered for overload resolution only if hash and equal functors used to instantiate the container have a nested is_transparent type. libstdc++-v3/ChangeLog: * include/bits/stl_tree.h (__has_is_transparent, __has_is_transparent_t): Move... * include/bits/stl_function.h: ...here. * include/bits/hashtable_policy.h (_Hash_code_base<>::_M_hash_code_tr): New.. (_Hashtable_base<>::_M_equals_tr): New. * include/bits/hashtable.h (_Hashtable<>::_M_find_tr, _Hashtable<>::_M_count_tr, _Hashtable<>::_M_equal_range_tr): New member function templates to perform heterogeneous lookup. (_Hashtable<>::_M_find_before_node_tr): New. (_Hashtable<>::_M_find_node_tr): New. * include/bits/unordered_map.h (unordered_map::find<>, unordered_map::count<>, unordered_map::contains<>, unordered_map::equal_range<>): New member function templates to perform heterogeneous lookup. (unordered_multimap::find<>, unordered_multimap::count<>, unordered_multimap::contains<>, unordered_multimap::equal_range<>): Likewise. * include/bits/unordered_set.h (unordered_set::find<>, unordered_set::count<>, unordered_set::contains<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::count<>, unordered_multiset::contains<>, unordered_multiset::equal_range<>): Likewise. * include/debug/unordered_map (unordered_map::find<>, unordered_map::equal_range<>): Likewise. (unordered_multimap::find<>, unordered_multimap::equal_range<>): Likewise. * include/debug/unordered_set (unordered_set::find<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::equal_range<>): Likewise. * testsuite/23_containers/unordered_map/operations/1.cc: New test. * testsuite/23_containers/unordered_multimap/operations/1.cc: New test. * testsuite/23_containers/unordered_multiset/operations/1.cc: New test. * testsuite/23_containers/unordered_set/operations/1.cc: New test.
2020-11-30 20:57:16 +01:00
#if __cplusplus > 201703L
template<typename _Kt,
typename = std::__has_is_transparent_t<_Hash, _Kt>,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
iterator
find(const _Kt& __k)
{ return { _Base::find(__k), this }; }
#endif
const_iterator
find(const key_type& __key) const
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{ return { _Base::find(__key), this }; }
libstdc++: Add unordered containers heterogeneous lookup Add unordered containers heterogeneous lookup member functions find, count, contains and equal_range in C++20. Those members are considered for overload resolution only if hash and equal functors used to instantiate the container have a nested is_transparent type. libstdc++-v3/ChangeLog: * include/bits/stl_tree.h (__has_is_transparent, __has_is_transparent_t): Move... * include/bits/stl_function.h: ...here. * include/bits/hashtable_policy.h (_Hash_code_base<>::_M_hash_code_tr): New.. (_Hashtable_base<>::_M_equals_tr): New. * include/bits/hashtable.h (_Hashtable<>::_M_find_tr, _Hashtable<>::_M_count_tr, _Hashtable<>::_M_equal_range_tr): New member function templates to perform heterogeneous lookup. (_Hashtable<>::_M_find_before_node_tr): New. (_Hashtable<>::_M_find_node_tr): New. * include/bits/unordered_map.h (unordered_map::find<>, unordered_map::count<>, unordered_map::contains<>, unordered_map::equal_range<>): New member function templates to perform heterogeneous lookup. (unordered_multimap::find<>, unordered_multimap::count<>, unordered_multimap::contains<>, unordered_multimap::equal_range<>): Likewise. * include/bits/unordered_set.h (unordered_set::find<>, unordered_set::count<>, unordered_set::contains<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::count<>, unordered_multiset::contains<>, unordered_multiset::equal_range<>): Likewise. * include/debug/unordered_map (unordered_map::find<>, unordered_map::equal_range<>): Likewise. (unordered_multimap::find<>, unordered_multimap::equal_range<>): Likewise. * include/debug/unordered_set (unordered_set::find<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::equal_range<>): Likewise. * testsuite/23_containers/unordered_map/operations/1.cc: New test. * testsuite/23_containers/unordered_multimap/operations/1.cc: New test. * testsuite/23_containers/unordered_multiset/operations/1.cc: New test. * testsuite/23_containers/unordered_set/operations/1.cc: New test.
2020-11-30 20:57:16 +01:00
#if __cplusplus > 201703L
template<typename _Kt,
typename = std::__has_is_transparent_t<_Hash, _Kt>,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
const_iterator
find(const _Kt& __k) const
{ return { _Base::find(__k), this }; }
#endif
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::count;
#if __cplusplus > 201703L
using _Base::contains;
#endif
std::pair<iterator, iterator>
equal_range(const key_type& __key)
{
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __res = _Base::equal_range(__key);
return { { __res.first, this }, { __res.second, this } };
}
libstdc++: Add unordered containers heterogeneous lookup Add unordered containers heterogeneous lookup member functions find, count, contains and equal_range in C++20. Those members are considered for overload resolution only if hash and equal functors used to instantiate the container have a nested is_transparent type. libstdc++-v3/ChangeLog: * include/bits/stl_tree.h (__has_is_transparent, __has_is_transparent_t): Move... * include/bits/stl_function.h: ...here. * include/bits/hashtable_policy.h (_Hash_code_base<>::_M_hash_code_tr): New.. (_Hashtable_base<>::_M_equals_tr): New. * include/bits/hashtable.h (_Hashtable<>::_M_find_tr, _Hashtable<>::_M_count_tr, _Hashtable<>::_M_equal_range_tr): New member function templates to perform heterogeneous lookup. (_Hashtable<>::_M_find_before_node_tr): New. (_Hashtable<>::_M_find_node_tr): New. * include/bits/unordered_map.h (unordered_map::find<>, unordered_map::count<>, unordered_map::contains<>, unordered_map::equal_range<>): New member function templates to perform heterogeneous lookup. (unordered_multimap::find<>, unordered_multimap::count<>, unordered_multimap::contains<>, unordered_multimap::equal_range<>): Likewise. * include/bits/unordered_set.h (unordered_set::find<>, unordered_set::count<>, unordered_set::contains<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::count<>, unordered_multiset::contains<>, unordered_multiset::equal_range<>): Likewise. * include/debug/unordered_map (unordered_map::find<>, unordered_map::equal_range<>): Likewise. (unordered_multimap::find<>, unordered_multimap::equal_range<>): Likewise. * include/debug/unordered_set (unordered_set::find<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::equal_range<>): Likewise. * testsuite/23_containers/unordered_map/operations/1.cc: New test. * testsuite/23_containers/unordered_multimap/operations/1.cc: New test. * testsuite/23_containers/unordered_multiset/operations/1.cc: New test. * testsuite/23_containers/unordered_set/operations/1.cc: New test.
2020-11-30 20:57:16 +01:00
#if __cplusplus > 201703L
template<typename _Kt,
typename = std::__has_is_transparent_t<_Hash, _Kt>,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
std::pair<iterator, iterator>
equal_range(const _Kt& __k)
{
auto __res = _Base::equal_range(__k);
return { { __res.first, this }, { __res.second, this } };
}
#endif
std::pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const
{
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __res = _Base::equal_range(__key);
return { { __res.first, this }, { __res.second, this } };
}
libstdc++: Add unordered containers heterogeneous lookup Add unordered containers heterogeneous lookup member functions find, count, contains and equal_range in C++20. Those members are considered for overload resolution only if hash and equal functors used to instantiate the container have a nested is_transparent type. libstdc++-v3/ChangeLog: * include/bits/stl_tree.h (__has_is_transparent, __has_is_transparent_t): Move... * include/bits/stl_function.h: ...here. * include/bits/hashtable_policy.h (_Hash_code_base<>::_M_hash_code_tr): New.. (_Hashtable_base<>::_M_equals_tr): New. * include/bits/hashtable.h (_Hashtable<>::_M_find_tr, _Hashtable<>::_M_count_tr, _Hashtable<>::_M_equal_range_tr): New member function templates to perform heterogeneous lookup. (_Hashtable<>::_M_find_before_node_tr): New. (_Hashtable<>::_M_find_node_tr): New. * include/bits/unordered_map.h (unordered_map::find<>, unordered_map::count<>, unordered_map::contains<>, unordered_map::equal_range<>): New member function templates to perform heterogeneous lookup. (unordered_multimap::find<>, unordered_multimap::count<>, unordered_multimap::contains<>, unordered_multimap::equal_range<>): Likewise. * include/bits/unordered_set.h (unordered_set::find<>, unordered_set::count<>, unordered_set::contains<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::count<>, unordered_multiset::contains<>, unordered_multiset::equal_range<>): Likewise. * include/debug/unordered_map (unordered_map::find<>, unordered_map::equal_range<>): Likewise. (unordered_multimap::find<>, unordered_multimap::equal_range<>): Likewise. * include/debug/unordered_set (unordered_set::find<>, unordered_set::equal_range<>): Likewise. (unordered_multiset::find<>, unordered_multiset::equal_range<>): Likewise. * testsuite/23_containers/unordered_map/operations/1.cc: New test. * testsuite/23_containers/unordered_multimap/operations/1.cc: New test. * testsuite/23_containers/unordered_multiset/operations/1.cc: New test. * testsuite/23_containers/unordered_set/operations/1.cc: New test.
2020-11-30 20:57:16 +01:00
#if __cplusplus > 201703L
template<typename _Kt,
typename = std::__has_is_transparent_t<_Hash, _Kt>,
typename = std::__has_is_transparent_t<_Pred, _Kt>>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __k) const
{
auto __res = _Base::equal_range(__k);
return { { __res.first, this }, { __res.second, this } };
}
#endif
size_type
erase(const key_type& __key)
{
size_type __ret(0);
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __pair = _Base::equal_range(__key);
for (auto __victim = __pair.first; __victim != __pair.second;)
{
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
_M_invalidate(__victim);
__victim = _Base::erase(__victim);
++__ret;
}
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
return __ret;
}
iterator
erase(const_iterator __it)
{
__glibcxx_check_erase(__it);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { _M_erase(__it.base()), this };
}
libstdc++: [_GLIBCXX_DEBUG] Reduce performance impact on std::erase_if Bypass the _GLIBCXX_DEBUG additional checks in std::__detail::__erase_node_if used by all implementations of std::erase_if for node based containers. libstdc++-v3/ChangeLog: * include/bits/erase_if.h (__erase_nodes_if): Add _UnsafeContainer template parameter. Use it to get iterators to work with. * include/debug/macros.h (__glibcxx_check_erase2): New. * include/debug/map.h (map<>::erase(_Base_const_iterator)): New. (map<>::erase(const_iterator)): Use latter. * include/debug/multimap.h (multimap<>::erase(_Base_const_iterator)): New. (multimap<>::erase(const_iterator)): Use latter. * include/debug/multiset.h (multiset<>::erase(_Base_const_iterator)): New. (multiset<>::erase(const_iterator)): Use latter. * include/debug/set.h (set<>::erase(_Base_const_iterator)): New. (set<>::erase(const_iterator)): Use latter. * include/debug/unordered_map (unordered_map<>::erase(_Base_const_iterator)): New. (unordered_multimap<>::erase(const_iterator)): New. * include/debug/unordered_set (unordered_set<>::erase(_Base_const_iterator)): New. (unordered_multiset<>::erase(const_iterator)): New. * include/experimental/map (erase_if): Adapt. * include/experimental/set (erase_if): Adapt. * include/experimental/unordered_map (erase_if): Adapt. * include/experimental/unordered_set (erase_if): Adapt. * include/std/map (erase_if): Adapt. * include/std/set (erase_if): Adapt. * include/std/unordered_map (erase_if): Adapt. * include/std/unordered_set (erase_if): Adapt.
2021-11-16 21:51:11 +01:00
_Base_iterator
erase(_Base_const_iterator __it)
{
__glibcxx_check_erase2(__it);
return _M_erase(__it);
}
2011-11-16 00:28:49 +01:00
iterator
erase(iterator __it)
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
{
__glibcxx_check_erase(__it);
return { _M_erase(__it.base()), this };
}
2011-11-16 00:28:49 +01:00
iterator
erase(const_iterator __first, const_iterator __last)
{
__glibcxx_check_erase_range(__first, __last);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
for (auto __tmp = __first.base(); __tmp != __last.base(); ++__tmp)
debug.cc: Introduce a mutex pool in get_safe_base_mutex. 2010-11-25 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Introduce a mutex pool in get_safe_base_mutex. Move code used to manipulate sequence safe iterators from safe iterator methods to safe sequence ones. Remove usage of safe iterator mutex, keep _Safe_iterator_base::_M_get_mutex for library backward binary compatibility. * src/Makefile.am: Build debug.cc in gnu++0x mode for _Hash_impl usage. * src/Makefile.in: Regenerate * include/debug/safe_base.h: Add _Safe_iterator_base _M_invalidate and _M_reset. Add _Safe_sequence_base _M_attach, _M_attach_single, _M_detach and _M_detach_single. * include/debug.safe_iterator.h, safe_iterator.tcc: Remove _Safe_iterator _M_invalidate and _M_invalidate_single. Implement all methods in terms of normal iterators rather than safe ones. * include/debug/safe_sequence.h: Replace _Safe_sequence _M_transfe_iter with _M_transfer_from_if taking the source sequence and a predicate signaling when a safe iterator shall be transfered. Add _Equal_to predicate. * include/debug/safe_sequence.tcc: New. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/debug/forward_list: Swap safe iterators in move constructor. Do not invalidate before begin in _M_invalidate_all method. Reimplement safe methods using normal iterators rather than safe ones. * include/debug/set.h, unordered_map, multiset.h, vector, unordered_set, deque, map.h, list, multimap.h: Reimplement safe method using normal iterators rather than safe ones. * testsuite/23_containers/forward_list/debug/clear.cc, swap.cc, move_constructor.cc, splice_after.cc, splice_after1.cc, splice_after2.cc, splice_after3.cc, splice_after4.cc: New. * testsuite/23_containers/vector/debug/multithreaded_swap.cc: New. From-SVN: r167152
2010-11-25 21:53:39 +01:00
{
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
_GLIBCXX_DEBUG_VERIFY(__tmp != _Base::cend(),
debug.cc: Introduce a mutex pool in get_safe_base_mutex. 2010-11-25 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Introduce a mutex pool in get_safe_base_mutex. Move code used to manipulate sequence safe iterators from safe iterator methods to safe sequence ones. Remove usage of safe iterator mutex, keep _Safe_iterator_base::_M_get_mutex for library backward binary compatibility. * src/Makefile.am: Build debug.cc in gnu++0x mode for _Hash_impl usage. * src/Makefile.in: Regenerate * include/debug/safe_base.h: Add _Safe_iterator_base _M_invalidate and _M_reset. Add _Safe_sequence_base _M_attach, _M_attach_single, _M_detach and _M_detach_single. * include/debug.safe_iterator.h, safe_iterator.tcc: Remove _Safe_iterator _M_invalidate and _M_invalidate_single. Implement all methods in terms of normal iterators rather than safe ones. * include/debug/safe_sequence.h: Replace _Safe_sequence _M_transfe_iter with _M_transfer_from_if taking the source sequence and a predicate signaling when a safe iterator shall be transfered. Add _Equal_to predicate. * include/debug/safe_sequence.tcc: New. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/debug/forward_list: Swap safe iterators in move constructor. Do not invalidate before begin in _M_invalidate_all method. Reimplement safe methods using normal iterators rather than safe ones. * include/debug/set.h, unordered_map, multiset.h, vector, unordered_set, deque, map.h, list, multimap.h: Reimplement safe method using normal iterators rather than safe ones. * testsuite/23_containers/forward_list/debug/clear.cc, swap.cc, move_constructor.cc, splice_after.cc, splice_after1.cc, splice_after2.cc, splice_after3.cc, splice_after4.cc: New. * testsuite/23_containers/vector/debug/multithreaded_swap.cc: New. From-SVN: r167152
2010-11-25 21:53:39 +01:00
_M_message(__gnu_debug::__msg_valid_range)
._M_iterator(__first, "first")
._M_iterator(__last, "last"));
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
_M_invalidate(__tmp);
debug.cc: Introduce a mutex pool in get_safe_base_mutex. 2010-11-25 François Dumont <francois.cppdevs@free.fr> * src/debug.cc: Introduce a mutex pool in get_safe_base_mutex. Move code used to manipulate sequence safe iterators from safe iterator methods to safe sequence ones. Remove usage of safe iterator mutex, keep _Safe_iterator_base::_M_get_mutex for library backward binary compatibility. * src/Makefile.am: Build debug.cc in gnu++0x mode for _Hash_impl usage. * src/Makefile.in: Regenerate * include/debug/safe_base.h: Add _Safe_iterator_base _M_invalidate and _M_reset. Add _Safe_sequence_base _M_attach, _M_attach_single, _M_detach and _M_detach_single. * include/debug.safe_iterator.h, safe_iterator.tcc: Remove _Safe_iterator _M_invalidate and _M_invalidate_single. Implement all methods in terms of normal iterators rather than safe ones. * include/debug/safe_sequence.h: Replace _Safe_sequence _M_transfe_iter with _M_transfer_from_if taking the source sequence and a predicate signaling when a safe iterator shall be transfered. Add _Equal_to predicate. * include/debug/safe_sequence.tcc: New. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/debug/forward_list: Swap safe iterators in move constructor. Do not invalidate before begin in _M_invalidate_all method. Reimplement safe methods using normal iterators rather than safe ones. * include/debug/set.h, unordered_map, multiset.h, vector, unordered_set, deque, map.h, list, multimap.h: Reimplement safe method using normal iterators rather than safe ones. * testsuite/23_containers/forward_list/debug/clear.cc, swap.cc, move_constructor.cc, splice_after.cc, splice_after1.cc, splice_after2.cc, splice_after3.cc, splice_after4.cc: New. * testsuite/23_containers/vector/debug/multithreaded_swap.cc: New. From-SVN: r167152
2010-11-25 21:53:39 +01:00
}
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
size_type __bucket_count = this->bucket_count();
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
auto __next = _Base::erase(__first.base(), __last.base());
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
_M_check_rehashed(__bucket_count);
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
return { __next, this };
}
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation so that any existing iterator on the transfered nodes is properly invalidated. Add typedef/using declarations for everything used as-is from normal implementation. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with typename. * include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept qualification. Use const_iterator for node extraction/reinsert. (_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract. * include/debug/safe_container.h (_Safe_container<>): Make all methods protected. * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New. (_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New. (_Safe_unordered_container<>::_M_invalide_all): Make public. (_Safe_unordered_container<>::_M_invalide_if): Likewise. (_Safe_unordered_container<>::_M_invalide_local_if): Likewise. * include/debug/unordered_map (unordered_map<>::mapped_type, pointer, const_pointer): New typedef. (unordered_map<>::reference, const_reference, difference_type): New typedef. (unordered_map<>::get_allocator, empty, size, max_size): Add usings. (unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_map<>::hash_function, key_equal, count, contains): Add usings. (unordered_map<>::operator[], at, rehash, reserve): Add usings. (unordered_map<>::merge): New. (unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multimap<>::reference, const_reference, difference_type): New typedef. (unordered_multimap<>::get_allocator, empty, size, max_size): Add usings. (unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multimap<>::hash_function, key_equal, count, contains): Add usings. (unordered_multimap<>::rehash, reserve): Add usings. (unordered_multimap<>::merge): New. * include/debug/unordered_set (unordered_set<>::mapped_type, pointer, const_pointer): New typedef. (unordered_set<>::reference, const_reference, difference_type): New typedef. (unordered_set<>::get_allocator, empty, size, max_size): Add usings. (unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_set<>::hash_function, key_equal, count, contains): Add usings. (unordered_set<>::rehash, reserve): Add usings. (unordered_set<>::merge): New. (unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef. (unordered_multiset<>::reference, const_reference, difference_type): New typedef. (unordered_multiset<>::get_allocator, empty, size, max_size): Add usings. (unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings. (unordered_multiset<>::hash_function, key_equal, count, contains): Add usings. (unordered_multiset<>::rehash, reserve): Add usings. (unordered_multiset<>::merge): New. * testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test. * testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test. * testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered container implementation.
2021-10-13 22:04:32 +02:00
using _Base::rehash;
using _Base::reserve;
_Base&
macros.h [...]: Add parameter to pass the 2 instances to check allocator equality. 2014-05-06 François Dumont <fdumont@gcc.gnu.org> * include/debug/macros.h [__glibcxx_check_equal_allocs]: Add parameter to pass the 2 instances to check allocator equality. * include/debug/safe_container.h: New, define _Safe_container<>. * include/Makefile.am: Add previous. * include/debug/deque (std::__debug::deque<>): Inherit _Safe_container<>. Use default implementation for all special functions. * include/debug/forward_list (std::__debug::forward_list<>): Likewise. * include/debug/list (std::__debug::list<>): Likewise. * include/debug/map.h (std::__debug::map<>): Likewise. * include/debug/multimap.h (std::__debug::multimap<>): Likewise. * include/debug/set.h (std::__debug::set<>): Likewise. * include/debug/multiset.h (std::__debug::multiset<>): Likewise. * include/debug/string (std::__debug::basic_string<>): Likewise. * include/debug/unordered_map (std::__debug::unordered_map<>): Likewise. (std::__debug::unordered_multimap<>): Likewise. * include/debug/unordered_set (std::__debug::unordered_set<>): Likewise. (std::__debug::unordered_multiset<>): Likewise. * include/debug/vector (std::__debug::vector<>): Likewise. * include/debug/safe_base.h (_Safe_sequence_base()): Add noexcept. (_Safe_sequence_base(_Safe_sequence_base&&): Remove. (~_Safe_sequence_base()): Add noexcept. * include/debug/safe_sequence.h (std::__debug::_Safe_node_sequence<>): New. * include/debug/safe_unordered_base.h (_Safe_unordered_container_base()): Add noexcept. (~_Safe_unordered_container_base()): Likewise. (_M_swap(_Safe_unordered_container_base&)): Likewise. * include/debug/safe_unordered_container.h: (_Safe_unordered_container<>::_M_invalidate_locals()): New. (_Safe_unordered_container<>::_M_invalidate_all()): New. * src/c++11/debug.cc: Limit includes, adapt methods noexcept qualifications. * testsuite/util/debug/checks.h (check_construct1): Just implement an invalid constructor invocation and no other operations potentially not supported by some types of container. (check_construct2): Likewise. (check_construct3): Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: Add check on iterators to make sure they are correctly moved in debug mode. * testsuite/23_containers/forward_list/allocator/move_assign.cc: Likewise. * testsuite/23_containers/map/allocator/move.cc: Likewise. * testsuite/23_containers/map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multimap/allocator/move.cc: Likewise. * testsuite/23_containers/multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/multiset/allocator/move.cc: Likewise. * testsuite/23_containers/multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/set/allocator/move.cc: Likewise. * testsuite/23_containers/set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/move_assign.cc: Likewise. * testsuite/23_containers/forward_list/debug/construct1_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct2_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct3_neg.cc: New. * testsuite/23_containers/forward_list/debug/construct4_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_assign_neg.cc: New. * testsuite/23_containers/forward_list/debug/move_neg.cc: New. * testsuite/23_containers/map/debug/construct5_neg.cc: New. * testsuite/23_containers/map/debug/move_assign_neg.cc: New. * testsuite/23_containers/map/debug/move_neg.cc: New. * testsuite/23_containers/multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/multimap/debug/move_neg.cc: New. * testsuite/23_containers/multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/multiset/debug/move_neg.cc: New. * testsuite/23_containers/set/debug/construct5_neg.cc: New. * testsuite/23_containers/set/debug/move_assign_neg.cc: New. * testsuite/23_containers/set/debug/move_neg.cc: New. * testsuite/23_containers/unordered_map/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_map/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/move_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/move_neg.cc: New. * testsuite/23_containers/unordered_set/debug/construct5_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_assign_neg.cc: New. * testsuite/23_containers/unordered_set/debug/move_neg.cc: New. * testsuite/23_containers/vector/debug/move_neg.cc: New. From-SVN: r210123
2014-05-06 21:59:44 +02:00
_M_base() noexcept { return *this; }
const _Base&
_M_base() const noexcept { return *this; }
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
private:
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
void
_M_check_rehashed(size_type __prev_count)
{
if (__prev_count != this->bucket_count())
this->_M_invalidate_all();
safe_unordered_base.h, [...]: New, support for unordered sequence safe local iterators. 2011-07-19 François Dumont <francois.cppdevs@free.fr> * include/debug/safe_unordered_base.h, safe_unordered_sequence.h, safe_unordered_sequence.tcc, safe_local_iterator.h, safe_local_iterator.tcc: New, support for unordered sequence safe local iterators. * include/Makefile.am: Add previous files. * include/Makefile.in: Regenerate. * include/debug/unordered_map, unordered_set: Implement _Safe_unordered_sequence and expose _Safe_local_iterator. * include/debug/safe_iterator.h, safe_iterator.tcc: Refactor _Safe_iterator::_M_get_distance static method to expose it as __get_distance function and use it in _Safe_local_iterator type. * include/debug/formatter.h: Add __msg_local_iter_compare_bad _Debug_msg_id enum entry to notify invalid comparison between local iterators from different buckets. Add _Parameter constructor from _Safe_local_iterator. * include/debug/functions.h: Add __valid_range overload for _Safe_local_iterator. * src/debug.cc: Add _Safe_unordered_sequence_base and _Safe_local_iterator_base methods implementations. * config/abi/pre/gnu.ver: Add export of some _Safe_unordered_sequence_base and _Safe_local_iterator_base methods. * testsuite/util/debug/checks.h: Add use_invalid_iterator function to simulate use of a singular iterator. * testsuite/util/debug/unordered_checks.h: New, several functions to simulate classic invalid usage of unordered sequence local iterators. * testsuite/23_containers/unordered_map/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multimap/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_set/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. * testsuite/23_containers/unordered_multiset/debug/ use_erased_local_iterator_neg.cc, invalid_local_iterator_range_neg.cc, use_invalid_local_iterator_neg.cc, use_invalid_iterator_neg.cc, invalid_local_iterator_compare_neg.cc: New. From-SVN: r176487
2011-07-19 21:39:45 +02:00
}
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
void
_M_invalidate(_Base_const_iterator __victim)
{
this->_M_invalidate_if(
[__victim](_Base_const_iterator __it) { return __it == __victim; });
this->_M_invalidate_local_if(
[__victim](_Base_const_local_iterator __it)
{ return __it == __victim; });
2018-10-24 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_unordered_container.h (_Safe_unordered_container<>::_M_invalidate_locals): Take lambda parameter type from local end variable. (_Safe_unordered_container<>::_M_invalidate_all): Likewise. * include/debug/unordered_map (unordered_map<>::begin()): Use C++11 direct initialization. (unordered_map<>::end()): Likewise. (unordered_map<>::cbegin()): Likewise. (unordered_map<>::cend()): Likewise. (unordered_map<>::begin(size_type)): Likewise. (unordered_map<>::end(size_type)): Likewise. (unordered_map<>::cbegin(size_type)): Likewise. (unordered_map<>::cend(size_type)): Likewise. (unordered_map<>::emplace<>(_Args&&...)): Likewise. (unordered_map<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_map<>::insert(const value_type&)): Likewise. (unordered_map<>::insert(value_type&&)): Likewise. (unordered_map<>::insert<>(_Pair&&)): Likewise. (unordered_map<>::insert(const_iterator, const value_type&)): Likewise. (unordered_map<>::insert(const_iterator, value_type&&)): Likewise. (unordered_map<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_map<>::try_emplace<>(const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(key_type&&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, const key_type&, _Args&&...)): Likewise. (unordered_map<>::try_emplace<>(const_iterator, key_type&&, _Args&&...)): Likewise. (unordered_map<>::insert_or_assign<>(const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, const key_type&, _Obj&&)): Likewise. (unordered_map<>::insert_or_assign<>(const_iterator, key_type&&, _Obj&&)): Likewise. (unordered_map<>::insert(note_type&&)): Likewise. (unordered_map<>::find(const key_type&)): Likewise. (unordered_map<>::equal_range(const key_type&)): Likewise. (unordered_map<>::_M_extract): New. (unordered_map<>::extract(const_iterator)): Use latter. (unordered_map<>::extract(const key_type&)): Likewise. (unordered_map<>::_M_erase): New. (unordered_map<>::erase(const key_type&)): Use latter. (unordered_map<>::erase(const_iterator)): Likewise. (unordered_map<>::erase(iterator)): Likewise. (unordered_map<>::_M_invalidate): New. (unordered_map<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multimap<>::begin()): Use C++11 direct initialization. (unordered_multimap<>::end()): Likewise. (unordered_multimap<>::cbegin()): Likewise. (unordered_multimap<>::cend()): Likewise. (unordered_multimap<>::begin(size_type)): Likewise. (unordered_multimap<>::end(size_type)): Likewise. (unordered_multimap<>::cbegin(size_type)): Likewise. (unordered_multimap<>::cend(size_type)): Likewise. (unordered_multimap<>::emplace<>(_Args&&...)): Likewise. (unordered_multimap<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multimap<>::insert(const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multimap<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multimap<>::insert<>(_Pair&&)): Likewise. (unordered_multimap<>::insert<>(const_iterator, _Pair&&)): Likewise. (unordered_multimap<>::insert(note_type&&)): Likewise. (unordered_multimap<>::insert(const_iterator, note_type&&)): Likewise. (unordered_multimap<>::find(const key_type&)): Likewise. (unordered_multimap<>::equal_range(const key_type&)): Likewise. (unordered_multimap<>::_M_extract): New. (unordered_multimap<>::extract(const_iterator)): Use latter. (unordered_multimap<>::extract(const key_type&)): Likewise. (unordered_multimap<>::_M_erase): New. (unordered_multimap<>::erase(const_iterator)): Likewise. (unordered_multimap<>::erase(iterator)): Likewise. (unordered_multimap<>::_M_invalidate): New. (unordered_multimap<>::erase(const key_type&)): Use latter. (unordered_multimap<>::erase(const_iterator, const_iterator)): Likewise. * include/debug/unordered_set (unordered_set<>::begin()): Use C++11 direct initialization. (unordered_set<>::end()): Likewise. (unordered_set<>::cbegin()): Likewise. (unordered_set<>::cend()): Likewise. (unordered_set<>::begin(size_type)): Likewise. (unordered_set<>::end(size_type)): Likewise. (unordered_set<>::cbegin(size_type)): Likewise. (unordered_set<>::cend(size_type)): Likewise. (unordered_set<>::emplace<>(_Args&&...)): Likewise. (unordered_set<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_set<>::insert(const value_type&)): Likewise. (unordered_set<>::insert(value_type&&)): Likewise. (unordered_set<>::insert(const_iterator, const value_type&)): Likewise. (unordered_set<>::insert(const_iterator, value_type&&)): Likewise. (unordered_set<>::insert(note_type&&)): Likewise. (unordered_set<>::insert(const_iterator, note_type&&)): Likewise. (unordered_set<>::find(const key_type&)): Likewise. (unordered_set<>::equal_range(const key_type&)): Likewise. (unordered_set<>::_M_extract): New. (unordered_set<>::extract(const_iterator)): Use latter. (unordered_set<>::extract(const key_type&)): Likewise. (unordered_set<>::_M_erase): New. (unordered_set<>::erase(const key_type&)): Use latter. (unordered_set<>::erase(const_iterator)): Likewise. (unordered_set<>::erase(iterator)): Likewise. (unordered_set<>::_M_invalidate): New. (unordered_set<>::erase(const_iterator, const_iterator)): Use latter. (unordered_multiset<>::begin()): Use C++11 direct initialization. (unordered_multiset<>::end()): Likewise. (unordered_multiset<>::cbegin()): Likewise. (unordered_multiset<>::cend()): Likewise. (unordered_multiset<>::begin(size_type)): Likewise. (unordered_multiset<>::end(size_type)): Likewise. (unordered_multiset<>::cbegin(size_type)): Likewise. (unordered_multiset<>::cend(size_type)): Likewise. (unordered_multiset<>::emplace<>(_Args&&...)): Likewise. (unordered_multiset<>::emplace_hint<>(const_iterator, _Args&&...)): Likewise. (unordered_multiset<>::insert(const value_type&)): Likewise. (unordered_multiset<>::insert(const_iterator, const value_type&)): Likewise. (unordered_multiset<>::insert(value_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, value_type&&)): Likewise. (unordered_multiset<>::insert(node_type&&)): Likewise. (unordered_multiset<>::insert(const_iterator, node_type&&)): Likewise. (unordered_multiset<>::find(const key_type&)): Likewise. (unordered_multiset<>::equal_range(const key_type&)): Likewise. (unordered_multiset<>::_M_extract): New. (unordered_multiset<>::extract(const_iterator)): Use latter. (unordered_multiset<>::extract(const key_type&)): Likewise. (unordered_multiset<>::_M_erase): New. (unordered_multiset<>::erase(const_iterator)): Likewise. (unordered_multiset<>::erase(iterator)): Likewise. (unordered_multiset<>::_M_invalidate): New. (unordered_multiset<>::erase(const key_type&)): Use latter. (unordered_multiset<>::erase(const_iterator, const_iterator)): Likewise. From-SVN: r265451
2018-10-24 07:40:25 +02:00
}
_Base_iterator
_M_erase(_Base_const_iterator __victim)
{
_M_invalidate(__victim);
size_type __bucket_count = this->bucket_count();
_Base_iterator __next = _Base::erase(__victim);
_M_check_rehashed(__bucket_count);
return __next;
}
#if __cplusplus > 201402L
node_type
_M_extract(_Base_const_iterator __victim)
{
_M_invalidate(__victim);
return _Base::extract(__victim);
}
#endif
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
};
#if __cpp_deduction_guides >= 201606
template<typename _InputIterator,
typename _Hash = hash<__iter_key_t<_InputIterator>>,
typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap<int, int>::size_type = {},
_Hash = _Hash(), _Pred = _Pred(),
_Allocator = _Allocator())
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash, _Pred,
_Allocator>;
template<typename _Key, typename _Tp, typename _Hash = hash<_Key>,
typename _Pred = equal_to<_Key>,
typename _Allocator = allocator<pair<const _Key, _Tp>>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireNotAllocator<_Pred>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(initializer_list<pair<_Key, _Tp>>,
unordered_multimap<int, int>::size_type = {},
_Hash = _Hash(), _Pred = _Pred(),
_Allocator = _Allocator())
-> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>;
template<typename _InputIterator, typename _Allocator,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap<int, int>::size_type, _Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template<typename _InputIterator, typename _Allocator,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator, _Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>,
hash<__iter_key_t<_InputIterator>>,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template<typename _InputIterator, typename _Hash, typename _Allocator,
typename = _RequireInputIter<_InputIterator>,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(_InputIterator, _InputIterator,
unordered_multimap<int, int>::size_type, _Hash,
_Allocator)
-> unordered_multimap<__iter_key_t<_InputIterator>,
__iter_val_t<_InputIterator>, _Hash,
equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
template<typename _Key, typename _Tp, typename _Allocator,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(initializer_list<pair<_Key, _Tp>>,
unordered_multimap<int, int>::size_type,
_Allocator)
-> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template<typename _Key, typename _Tp, typename _Allocator,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
-> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
template<typename _Key, typename _Tp, typename _Hash, typename _Allocator,
typename = _RequireNotAllocatorOrIntegral<_Hash>,
typename = _RequireAllocator<_Allocator>>
unordered_multimap(initializer_list<pair<_Key, _Tp>>,
unordered_multimap<int, int>::size_type,
_Hash, _Allocator)
-> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
#endif
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
inline void
swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/forward_list.h (forward_list::swap): Make noexcept unconditional. * include/bits/hashtable.h (_Hashtable::swap): Do not use _S_nothrow_swap(). * include/bits/stl_bvector.h (vector<bool>::swap): Make noexcept unconditional. * include/bits/stl_deque.h (deque::swap): Likewise. (swap(deque&, deque&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_list.h (list::swap): Make noexcept unconditional. (swap(list&, list&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_map.h (map::swap, swap(map&, map&)): Use _GLIBCXX_NOEXCEPT_IF, do not depend on _S_nothrow_swap. * include/bits/stl_multimap.h (multimap::swap, swap(multimap&, multimap&)): Likewise. * include/bits/stl_multiset.h (multiset::swap, swap(multiset&, multiset&)): Likewise. * include/bits/stl_set.h (set::swap, swap(set&, set&)): Likewise. * include/bits/stl_tree.h (_Rb_tree::swap, swap(_Rb_tree&, _Rb_tree&)): Likewise. * include/bits/stl_vector.h (vector::swap): Make noexcept unconditional. (swap(vector&, vector&)): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/deque (deque::swap, swap): Likewise. * include/debug/forward_list (swap): Add noexcept. * include/debug/list (list::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/map.h (map::swap, swap): Likewise. * include/debug/multimap.h (multimap::swap, swap): Likewise. * include/debug/multiset.h (multiset::Swap, swap): Likewise. * include/debug/set.h (set::swap, swap): Likewise. * include/debug/unordered_map (unordered_map::swap, unordered_multimap::swap, swap): Likewise. * include/debug/unordered_set (unordered_set::swap, unordered_multiset::swap, swap): Likewise. * include/debug/vector (vector::swap, swap): Likewise. * include/ext/alloc_traits.h (__alloc_traits::_S_nothrow_swap()): Remove. * include/profile/deque (deque::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/profile/forward_list (swap): Add noexcept. * include/profile/list (list::swap, swap) : Use _GLIBCXX_NOEXCEPT_IF. * include/profile/map.h (map::swap, swap): Likewise. * include/profile/multimap.h (multimap::swap, swap): Likewise. * include/profile/multiset.h (multiset::swap, swap): Likewise. * include/profile/set.h (set::swap, swap): Likewise. * include/profile/unordered_map (swap): Likewise. * include/profile/unordered_set (swap): Likewise. * include/profile/vector (vector::swap, swap): Likewise. Remove overloads for swapping rvalues. * testsuite/23_containers/deque/allocator/noexcept.cc: Update tests for noexcept on swap. * testsuite/23_containers/forward_list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/bool/allocator/noexcept.cc: Likewise. * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line number. From-SVN: r225744
2015-07-13 19:15:48 +02:00
noexcept(noexcept(__x.swap(__y)))
unordered_map (operator==(const unordered_map&, const unordered_map&), [...]): Remove. 2007-12-03 Paolo Carlini <pcarlini@suse.de> * include/debug/unordered_map (operator==(const unordered_map&, const unordered_map&), operator!=(const unordered_map&, const unordered_map&), operator==(const unordered_multimap&, const unordered_multimap&), operator!=(const unordered_multimap&, const unordered_multimap&)): Remove. (unordered_map<>::unordered_map(unordered_map&&), operator=(unordered_map&&), clear, _M_invalidate_all, unordered_multimap<>::unordered_multimap(unordered_multimap&&), operator=(unordered_map&&), clear, _M_invalidate_all, swap(unordered_map<>&&, unordered_map<>&), swap(unordered_map<>&, unordered_map<>&&), swap(unordered_multimap<>&&, unordered_multimap<>&), swap(unordered_multimap<>&, unordered_multimap<>&&)): Add. * include/debug/unordered_set (operator==(const unordered_set&, const unordered_set&), operator!=(const unordered_set&, const unordered_set&), operator==(const unordered_multiset&, const unordered_multiset&), operator!=(const unordered_multiset&, const unordered_multiset&)): Remove. (unordered_set<>::unordered_set(unordered_set&&), operator=(unordered_set&&), clear, _M_invalidate_all, unordered_multiset<>::unordered_multiset(unordered_multiset&&), operator=(unordered_set&&), clear, _M_invalidate_all, swap(unordered_set<>&&, unordered_set<>&), swap(unordered_set<>&, unordered_set<>&&), swap(unordered_multiset<>&&, unordered_multiset<>&), swap(unordered_multiset<>&, unordered_multiset<>&&)): Add. * include/debug/safe_association.h (_Safe_association<>:: _Safe_association(_Safe_association&&)): Add. (_Safe_association<>::clear, _M_invalidate_all): Remove. From-SVN: r130581
2007-12-03 14:12:51 +01:00
{ __x.swap(__y); }
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
inline bool
operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return __x._M_base() == __y._M_base(); }
#if __cpp_impl_three_way_comparison < 201907L
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
inline bool
operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); }
#endif
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
} // namespace __debug
} // namespace std
#endif // C++11
re PR libstdc++/30085 (switch debug mode hash containers from ext to tr1) 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hash_map: To... * include/backward/hash_map: ...here. Remove debug mode. * include/ext/hash_set: To... * include/backward/hash_set: ...here. Remove debug mode. * include/ext/hash_fun.h: To... * include/backward/hash_fun.h: ...here. * include/ext/hashtable.h: To... * include/backward/hashtable.h: ...here. * include/bits/c++config: Remove __gnu_cxx namespace from debug mode. * include/debug/debug.h: Same. * include/debug/hash_map: Remove. * include/debug/hash_multimap.h: Remove. * include/debug/hash_set.h: Remove. * include/debug/hash_set: Remove. * include/debug/hash_multiset.h: Remove. * include/debug/hash_map.h: Remove. * include/Makefile.am (ext_headers): Move hash_set, hash_map to backward. (debug_headers): Remove hash_map, hash_set, hash_map.h, hash_map.h, hash_multiset.h, hash_multimap.h. * include/Makefile.in: Regenerate. * docs/html/debug.html: Update. * docs/html/ext/howto.html: Same. * docs/html/faq/index.html: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/user.cfg.in: Adjust includes. * testsuite/ext/hash_map: Move to... * testsuite/backward/hash_map: ...here. * testsuite/ext/hash_set: Move to... * testsuite/backward/hash_set: ...here. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> Removal of pre-ISO C++ items from include/backwards. * include/Makefile.am (backward_headers): Remove all but strstream, backward_warning.h. * include/Makefile.in: Regenerate. * include/backward/new.h: Remove. * include/backward/iterator.h: Same. * include/backward/alloc.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/hash_set.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/defalloc.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * testsuite/backward/header_hash_set_h.cc: Same. * testsuite/backward/header_slist_h.cc: Same. * testsuite/backward/header_hash_map_h.cc: Same. * testsuite/backward/header_tempbuf_h.cc: Same. * testsuite/backward/header_deque_h.cc: Same. * testsuite/backward/header_rope_h.cc: Same. * testsuite/backward/header_iterator_h.cc: Same. * testsuite/backward/header_hashtable_h.cc: Same. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/30085 * include/debug/unordered_map: New. * include/debug/unordered_set: New. * include/debug/safe_association.h: New. * include/std/unordered_map: Include debug header if _GLIBCXX_DEBUG. * include/std/unordered_set: Same. * include/Makefile.am (debug_headers): Add unordered_map, unordered_set, safe_association.h. * include/Makefile.in: Regenerate. * testsuite/23_containers/unordered_map/requirements/debug.cc: New. * testsuite/23_containers/unordered_multimap/requirements/ debug.cc: New. * testsuite/23_containers/unordered_set/requirements/debug.cc: New. * testsuite/23_containers/unordered_multiset/requirements/ debug.cc: New. 2007-10-18 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Remove hash_map include. From-SVN: r129442
2007-10-18 17:22:58 +02:00
#endif