2001-06-27 19:09:53 +02:00
|
|
|
// Map implementation -*- C++ -*-
|
|
|
|
|
2013-02-03 18:54:05 +01:00
|
|
|
// Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
2001-06-27 19:09:53 +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
|
2009-04-09 17:00:19 +02:00
|
|
|
// Free Software Foundation; either version 3, or (at your option)
|
2001-06-27 19:09:53 +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.
|
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
// 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.
|
2001-06-27 19:09:53 +02:00
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
// 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/>.
|
2001-06-27 19:09:53 +02:00
|
|
|
|
2000-10-05 13:27:02 +02:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright (c) 1994
|
|
|
|
* Hewlett-Packard Company
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, distribute and sell this software
|
|
|
|
* and its documentation for any purpose is hereby granted without fee,
|
|
|
|
* provided that the above copyright notice appear in all copies and
|
|
|
|
* that both that copyright notice and this permission notice appear
|
|
|
|
* in supporting documentation. Hewlett-Packard Company makes no
|
|
|
|
* representations about the suitability of this software for any
|
|
|
|
* purpose. It is provided "as is" without express or implied warranty.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (c) 1996,1997
|
|
|
|
* Silicon Graphics Computer Systems, Inc.
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, distribute and sell this software
|
|
|
|
* and its documentation for any purpose is hereby granted without fee,
|
|
|
|
* provided that the above copyright notice appear in all copies and
|
|
|
|
* that both that copyright notice and this permission notice appear
|
|
|
|
* in supporting documentation. Silicon Graphics makes no
|
|
|
|
* representations about the suitability of this software for any
|
|
|
|
* purpose. It is provided "as is" without express or implied warranty.
|
|
|
|
*/
|
|
|
|
|
2010-12-19 10:21:16 +01:00
|
|
|
/** @file bits/stl_map.h
|
c_io_stdio.h: Correct grammar in comments.
2001-11-02 Phil Edwards <pme@gcc.gnu.org>
* config/io/c_io_stdio.h: Correct grammar in comments.
* docs/doxygen/Intro.3: Expand "top-level" man page.
* docs/doxygen/doxygroups.cc: New module definitions (comments).
* docs/doxygen/mainpage.doxy: Tweaks.
* docs/doxygen/run_doxygen: Update Doxygen version, massage man pages.
Add @file hooks so that headers are considered to be documented.
* include/bits/basic_ios.h, include/bits/basic_file.h,
include/bits/basic_string.h, include/bits/boost_concept_check.h,
include/bits/char_traits.h, include/bits/codecvt.h,
include/bits/concept_check.h, include/bits/cpp_type_traits.h,
include/bits/fpos.h, include/bits/gslice.h, include/bits/gslice_array.h,
include/bits/indirect_array.h, include/bits/ios_base.h,
include/bits/locale_facets.h, include/bits/localefwd.h,
include/bits/mask_array.h, include/bits/pthread_allocimpl.h,
include/bits/slice.h, include/bits/slice_array.h,
include/bits/std_algorithm.h, include/bits/std_bitset.h,
include/bits/std_complex.h, include/bits/std_deque.h,
include/bits/std_fstream.h, include/bits/std_functional.h,
include/bits/std_iomanip.h, include/bits/std_ios.h,
include/bits/std_iosfwd.h, include/bits/std_iostream.h,
include/bits/std_istream.h, include/bits/std_iterator.h,
include/bits/std_limits.h, include/bits/std_list.h,
include/bits/std_locale.h, include/bits/std_map.h,
include/bits/std_memory.h, include/bits/std_numeric.h,
include/bits/std_ostream.h, include/bits/std_queue.h,
include/bits/std_set.h, include/bits/std_sstream.h,
include/bits/std_stack.h, include/bits/std_streambuf.h,
include/bits/std_string.h, include/bits/std_utility.h,
include/bits/std_valarray.h, include/bits/std_vector.h,
include/bits/stl_algo.h, include/bits/stl_alloc.h,
include/bits/stl_bvector.h, include/bits/stl_construct.h,
include/bits/stl_deque.h, include/bits/stl_heap.h,
include/bits/stl_iterator.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_iterator_base_types.h, include/bits/stl_list.h,
include/bits/stl_map.h, include/bits/stl_multimap.h,
include/bits/stl_multiset.h, include/bits/stl_numeric.h,
include/bits/stl_pair.h, include/bits/stl_pthread_alloc.h,
include/bits/stl_queue.h, include/bits/stl_raw_storage_iter.h,
include/bits/stl_relops.h, include/bits/stl_set.h,
include/bits/stl_stack.h, include/bits/stl_tempbuf.h,
include/bits/stl_threads.h, include/bits/stl_tree.h,
include/bits/stl_uninitialized.h, include/bits/stl_vector.h,
include/bits/stream_iterator.h, include/bits/streambuf_iterator.h,
include/bits/stringfwd.h, include/bits/type_traits.h,
include/bits/valarray_array.h, include/bits/valarray_meta.h:
Add hooks, tweak comments only.
* include/bits/stl_algobase.h (swap, min, iter_swap): Also
document these functions.
* include/bits/stl_function.h: Tweak link comments.
From-SVN: r46717
2001-11-02 18:38:11 +01:00
|
|
|
* This is an internal header file, included by other library headers.
|
2010-12-19 10:21:16 +01:00
|
|
|
* Do not attempt to use it directly. @headername{map}
|
2000-10-05 13:27:02 +02:00
|
|
|
*/
|
|
|
|
|
2007-06-18 19:22:53 +02:00
|
|
|
#ifndef _STL_MAP_H
|
|
|
|
#define _STL_MAP_H 1
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2005-08-29 18:11:19 +02:00
|
|
|
#include <bits/functexcept.h>
|
2001-04-03 02:26:58 +02:00
|
|
|
#include <bits/concept_check.h>
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
Implement WG21 N2672, Initializer List proposed wording
gcc/cp/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
Implement WG21 N2672, Initializer List proposed wording
* cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
(struct lang_type_class): Add has_list_ctor bitfield.
(TYPE_HAS_LIST_CTOR): New macro.
(BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
(CONSTRUCTOR_IS_DIRECT_INIT): New macro.
(LOOKUP_NO_NARROWING): New macro.
(LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
* parser.c (cp_parse_braced_list): Split out from...
(cp_parser_initializer_clause): ...here.
(cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
literal here.
(cp_lexer_next_token_is_not_keyword): New fn.
(cp_parser_parenthesized_expression_list): Handle { }.
(cp_parser_new_expression, cp_parser_new_initializer): Likewise.
(cp_parser_assignment_expression, cp_parser_condition): Likewise.
(cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
(cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
(cp_parser_initializer, cp_parser_functional_cast): Likewise.
(cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
(cp_parser_save_member_function_body): Likewise.
* call.c (conversion_kind): Add ck_list, ck_aggr.
(struct conversion): Add check_narrowing bitfield, conversion list.
(build_list_conv): New fn.
(build_aggr_conv): New fn.
(implicit_conversion): Call them.
(standard_conversion): Set check_narrowing if appropriate.
(add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
(build_user_type_conversion_1): When converting from an init list,
we allow additional conversions except when calling a copy ctor.
(convert_like_real): Calling an explicit ctor for an init list is
ill-formed. Handle ck_list and ck_addr. Check narrowing.
(build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
class doesn't have a list ctor, break the {} into a TREE_LIST.
(compare_ics): ck_list is better than other UDCs.
(set_up_extended_ref_temp): Split out from initialize_reference.
(is_std_init_list): New fn.
(is_list_ctor): New fn.
* decl.c (cxx_init_decl_processing): Create init_list_type_node.
(reshape_init_array_1): Pass it to build_constructor.
(reshape_init_class): Ditto.
(initialize_artificial_var): Pass the appropriate type.
(build_aggr_init_full_exprs): Split out from...
(check_initializer): ...here. Handle new semantics.
(build_init_list_var_init): New subroutine of check_initializer.
(grokdeclarator): Converting constructors can have more than one parm.
(grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
* init.c (expand_default_init): Only do digest_init for aggregates.
* rtti.c (tinfo_base_init): Pass init_list_type_node to
build_constructor_from_list.
(generic_initializer, ptr_initializer): Ditto.
(ptm_initializer, class_initializer): Ditto.
(get_pseudo_ti_init): Ditto.
* error.c (dump_type): Handle init_list_type_node.
(maybe_warn_cpp0x): New fn.
(maybe_varn_variadic_templates): Call it.
* cvt.c (ocp_convert): Handle conversion from { }.
* tree.c (build_array_of_n_type): New fn.
* typeck2.c (store_init_value): Use init_list_type_node.
(digest_init): Likewise.
(check_narrowing): New fn.
* semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
of vector of constructor elts. Handle non-aggregate types. Make
constant literals static.
* pt.c: (tsubst_copy_and_build): Adjust.
(unify): Handle { }.
* name-lookup.c (arg_assoc_type): Handle init_list_type_node.
gcc/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
* tree.c (ctor_to_list): New fn.
* tree.h: Declare it.
(CONSTRUCTOR_ELT): New macro.
(CONSTRUCTOR_NELTS): New macro.
libstdc++-v3/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
* libsupc++/initializer_list: New file.
* include/bits/stl_map.h (insert(initializer_list)): New method.
From-SVN: r137361
2008-07-02 17:38:50 +02:00
|
|
|
#include <initializer_list>
|
re PR libstdc++/44436 ([C++0x] Implement emplace* in associative containers)
2012-09-24 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/44436
* include/bits/stl_tree.h
(_Rb_tree<>::_M_insert_): Take _Base_ptr rather than
_Const_Base_ptr.
(_Rb_tree<>::_M_insert_node): New.
(_Rb_tree<>::_M_get_insert_unique_pos): New, search code of
_M_insert_unique method.
(_Rb_tree<>::_M_insert_unique): Use latter.
(_Rb_tree<>::_M_emplace_unique): New, likewise.
(_Rb_tree<>::_M_get_insert_equal_pos): New, search code of
_M_insert_equal method.
(_Rb_tree<>::_M_insert_equal): Use latter.
(_Rb_tree<>::_M_emplace_equal): New, likewise.
(_Rb_tree<>::_M_get_insert_hint_unique_pos): New, search code of
_M_insert_unique_ method.
(_Rb_tree<>::_M_insert_unique_): Use latter.
(_Rb_tree<>::_M_emplace_hint_unique): New, likewise.
(_Rb_tree<>::_M_get_insert_hint_equal_pos): New, search code of
_M_insert_equal_ method.
(_Rb_tree<>::_M_insert_equal_): Use latter.
(_Rb_tree<>::_M_emplace_hint_equal): New, likewise.
(_Rb_tree<>::_M_insert_lower): Remove first _Base_ptr parameter,
useless as always null.
* include/bits/stl_map.h: Include <tuple> in C++11.
(map<>::operator[](const key_type&)): Use
_Rb_tree<>::_M_emplace_hint_unique in C++11.
(map<>::operator[](key_type&&)): Likewise.
(map<>::emplace): New.
(map<>::emplace_hint): New.
* include/bits/stl_multimap.h (multimap<>::emplace): New.
(multimap<>::emplace_hint): New.
* include/bits/stl_set.h (set<>::emplace): New.
(set<>::emplace_hint): New.
* include/bits/stl_multiset.h (multiset<>::emplace): New.
(multiset<>::emplace_hint): New.
* include/debug/map.h (std::__debug::map<>::emplace): New.
(std::__debug::map<>::emplace_hint): New.
* include/debug/multimap.h (std::__debug::multimap<>::emplace):
New.
(std::__debug::multimap<>::emplace_hint): New.
* include/debug/set.h (std::__debug::set<>::emplace): New.
(std::__debug::set<>::emplace_hint): New.
* include/debug/multiset.h (std::__debug::multiset<>::emplace):
New.
(std::__debug::multiset<>::emplace_hint): New.
* include/profile/map.h (std::__profile::map<>::emplace): New.
(std::__profile::map<>::emplace_hint): New.
* include/profile/multimap.h (std::__profile::multimap<>::emplace):
New.
(std::__profile::multimap<>::emplace_hint): New.
* include/profile/set.h (std::__profile::set<>::emplace): New.
(std::__profile::set<>::emplace_hint): New.
* include/profile/multiset.h (std::__profile::multiset<>::emplace):
New.
(std::__profile::multiset<>::emplace_hint): New.
* testsuite/util/testsuite_container_traits.h: Signal that emplace
and emplace_hint are available on std::map, std::multimap,
std::set and std::multiset in C++11.
* testsuite/23_containers/map/operators/2.cc: New.
* testsuite/23_containers/map/modifiers/emplace/1.cc: New.
* testsuite/23_containers/multimap/modifiers/emplace/1.cc: New.
* testsuite/23_containers/set/modifiers/emplace/1.cc: New.
* testsuite/23_containers/multiset/modifiers/emplace/1.cc: New.
From-SVN: r191679
2012-09-24 21:53:36 +02:00
|
|
|
#include <tuple>
|
2011-11-01 05:02:45 +01:00
|
|
|
#endif
|
2000-10-05 13:27:02 +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)
|
|
|
|
{
|
|
|
|
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
2005-12-19 01:56:05 +01:00
|
|
|
|
2002-06-22 05:03:56 +02:00
|
|
|
/**
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
* @brief A standard container made up of (key,value) pairs, which can be
|
|
|
|
* retrieved based on a key, in logarithmic time.
|
2002-06-22 05:03:56 +02:00
|
|
|
*
|
2009-02-19 09:15:15 +01:00
|
|
|
* @ingroup associative_containers
|
2002-06-22 05:03:56 +02:00
|
|
|
*
|
2012-05-03 00:25:28 +02:00
|
|
|
* @tparam _Key Type of key objects.
|
|
|
|
* @tparam _Tp Type of mapped objects.
|
|
|
|
* @tparam _Compare Comparison function object type, defaults to less<_Key>.
|
|
|
|
* @tparam _Alloc Allocator type, defaults to
|
|
|
|
* allocator<pair<const _Key, _Tp>.
|
|
|
|
*
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
* Meets the requirements of a <a href="tables.html#65">container</a>, a
|
|
|
|
* <a href="tables.html#66">reversible container</a>, and an
|
|
|
|
* <a href="tables.html#69">associative container</a> (using unique keys).
|
|
|
|
* For a @c map<Key,T> the key_type is Key, the mapped_type is T, and the
|
|
|
|
* value_type is std::pair<const Key,T>.
|
2002-06-22 05:03:56 +02:00
|
|
|
*
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
* Maps support bidirectional iterators.
|
2002-06-22 05:03:56 +02:00
|
|
|
*
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
* The private tree data is declared exactly the same way for map and
|
|
|
|
* multimap; the distinction is made entirely in how the tree functions are
|
|
|
|
* called (*_unique versus *_equal, same as the standard).
|
|
|
|
*/
|
2005-05-10 03:58:19 +02:00
|
|
|
template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
|
|
|
|
typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
class map
|
2004-02-01 18:34:44 +01:00
|
|
|
{
|
2004-02-02 00:19:55 +01:00
|
|
|
public:
|
2004-02-01 18:34:44 +01:00
|
|
|
typedef _Key key_type;
|
|
|
|
typedef _Tp mapped_type;
|
2005-05-10 03:58:19 +02:00
|
|
|
typedef std::pair<const _Key, _Tp> value_type;
|
2004-02-01 18:34:44 +01:00
|
|
|
typedef _Compare key_compare;
|
2005-06-03 19:07:48 +02:00
|
|
|
typedef _Alloc allocator_type;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// concept requirements
|
|
|
|
typedef typename _Alloc::value_type _Alloc_value_type;
|
|
|
|
__glibcxx_class_requires(_Tp, _SGIAssignableConcept)
|
|
|
|
__glibcxx_class_requires4(_Compare, bool, _Key, _Key,
|
|
|
|
_BinaryFunctionConcept)
|
|
|
|
__glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept)
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2005-06-03 19:07:48 +02:00
|
|
|
public:
|
2004-02-01 18:34:44 +01:00
|
|
|
class value_compare
|
2005-05-10 03:58:19 +02:00
|
|
|
: public std::binary_function<value_type, value_type, bool>
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
{
|
2005-06-03 19:07:48 +02:00
|
|
|
friend class map<_Key, _Tp, _Compare, _Alloc>;
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
protected:
|
2004-02-01 18:34:44 +01:00
|
|
|
_Compare comp;
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
value_compare(_Compare __c)
|
2004-02-02 00:19:55 +01:00
|
|
|
: comp(__c) { }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
public:
|
2004-02-01 18:34:44 +01:00
|
|
|
bool operator()(const value_type& __x, const value_type& __y) const
|
|
|
|
{ return comp(__x.first, __y.first); }
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
};
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
private:
|
2008-01-18 09:16:51 +01:00
|
|
|
/// This turns a red-black tree into a [multi]map.
|
2005-06-03 19:07:48 +02:00
|
|
|
typedef typename _Alloc::template rebind<value_type>::other
|
|
|
|
_Pair_alloc_type;
|
|
|
|
|
|
|
|
typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
|
|
|
|
key_compare, _Pair_alloc_type> _Rep_type;
|
|
|
|
|
2008-01-18 09:16:51 +01:00
|
|
|
/// The actual tree structure.
|
2004-02-01 18:34:44 +01:00
|
|
|
_Rep_type _M_t;
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
public:
|
|
|
|
// many of these are specified differently in ISO, but the following are
|
|
|
|
// "functionally equivalent"
|
2005-06-03 19:07:48 +02:00
|
|
|
typedef typename _Pair_alloc_type::pointer pointer;
|
|
|
|
typedef typename _Pair_alloc_type::const_pointer const_pointer;
|
|
|
|
typedef typename _Pair_alloc_type::reference reference;
|
|
|
|
typedef typename _Pair_alloc_type::const_reference const_reference;
|
2004-06-09 23:37:46 +02:00
|
|
|
typedef typename _Rep_type::iterator iterator;
|
|
|
|
typedef typename _Rep_type::const_iterator const_iterator;
|
|
|
|
typedef typename _Rep_type::size_type size_type;
|
|
|
|
typedef typename _Rep_type::difference_type difference_type;
|
|
|
|
typedef typename _Rep_type::reverse_iterator reverse_iterator;
|
|
|
|
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
// [23.3.1.1] construct/copy/destroy
|
|
|
|
// (get_allocator() is normally listed in this section, but seems to have
|
|
|
|
// been accidentally omitted in the printed standard)
|
|
|
|
/**
|
|
|
|
* @brief Default constructor creates no elements.
|
|
|
|
*/
|
|
|
|
map()
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
: _M_t() { }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
* @brief Creates a %map with no elements.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __comp A comparison object.
|
|
|
|
* @param __a An allocator object.
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
|
|
|
explicit
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
map(const _Compare& __comp,
|
|
|
|
const allocator_type& __a = allocator_type())
|
re PR libstdc++/50118 (node-based containers cannot use allocators with explicit constructor template)
2011-08-29 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/50118
* include/bits/stl_list.h (_List_base<>::
_List_base(const allocator_type&)): Remove.
(_List_base<>::_List_base(const _Node_alloc_type&)): Add.
(list<>:list(const allocator_type&), list(size_type, const
value_type&, const allocator_type&),
list(initializer_list<, const allocator_type&),
list(_InputIterator, _InputIterator, const allocator_type&),
insert(iterator, size_type, const value_type&),
insert(iterator, _InputIterator, _InputIterator)): Adjust.
* include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(const _Compare&,
const allocator_type&)): Fix.
* include/bits/stl_map.h (map<>::map(const _Compare&,
const allocator_type&), map(initializer_list<>,
const _Compare&, const allocator_type&), map(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Adjust.
* include/bits/stl_set.h (set<>::set(const _Compare&,
const allocator_type&), set(initializer_list<>,
const _Compare&, const allocator_type&), set(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/stl_multimap.h (multimap<>::multimap(const _Compare&,
const allocator_type&), multimap(initializer_list<>,
const _Compare&, const allocator_type&), multimap(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/stl_multiset.h (multiset<>::multiset(const _Compare&,
const allocator_type&), multiset(initializer_list<>,
const _Compare&, const allocator_type&), multiset(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/forward_list.h (_Fwd_list_base<>::
_Fwd_list_base(const _Alloc&), _Fwd_list_base(const _Fwd_list_base&,
const _Alloc&), _Fwd_list_base(_Fwd_list_base&&, const _Alloc&)):
Remove.
(_Fwd_list_base<>::_Fwd_list_base(const _Node_alloc_type&),
_Fwd_list_base(const _Fwd_list_base&,
const _Node_alloc_type&), _Fwd_list_base(_Fwd_list_base&&,
const _Node_alloc_type&)): Add.
(forward_list<>::forward_list(const _Alloc&),
forward_list(const forward_list&, const _Alloc&),
forward_list(forward_list&&, const _Alloc&),
forward_list(size_type, const _Tp&, const _Alloc&),
forward_list(_InputIterator, _InputIterator, const _Alloc&),
forward_list(std::initializer_list<>, const _Alloc&),
get_allocator): Adjust.
* include/bits/forward_list.tcc
* testsuite/util/testsuite_allocator.h (ExplicitConsAlloc): Add.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation/5.cc: New.
* testsuite/23_containers/multimap/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/multimap/requirements/
explicit_instantiation/5_c++0x.cc: Likewise.
* testsuite/23_containers/set/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/set/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation/5.cc: Likewise.
testsuite/23_containers/multiset/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/multiset/requirements/
explicit_instantiation/5_c++0x.cc: Likewise.
* testsuite/23_containers/list/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/list/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/map/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/map/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Adjust dg-error line number.
* 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/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.
From-SVN: r178230
2011-08-29 15:40:33 +02:00
|
|
|
: _M_t(__comp, _Pair_alloc_type(__a)) { }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
* @brief %Map copy constructor.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x A %map of identical element and allocator types.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
* The newly-created %map uses a copy of the allocation object
|
2011-08-07 09:27:06 +02:00
|
|
|
* used by @a __x.
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
|
|
|
map(const map& __x)
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
: _M_t(__x._M_t) { }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
/**
|
|
|
|
* @brief %Map move constructor.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x A %map of identical element and allocator types.
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
*
|
2011-08-07 09:27:06 +02:00
|
|
|
* The newly-created %map contains the exact contents of @a __x.
|
|
|
|
* The contents of @a __x are a valid, but unspecified %map.
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
*/
|
|
|
|
map(map&& __x)
|
2011-06-01 16:16:19 +02:00
|
|
|
noexcept(is_nothrow_copy_constructible<_Compare>::value)
|
2010-08-05 09:34:08 +02:00
|
|
|
: _M_t(std::move(__x._M_t)) { }
|
2008-07-21 21:40:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Builds a %map from an initializer_list.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __l An initializer_list.
|
|
|
|
* @param __comp A comparison object.
|
|
|
|
* @param __a An allocator object.
|
2008-07-21 21:40:39 +02:00
|
|
|
*
|
|
|
|
* Create a %map consisting of copies of the elements in the
|
2011-08-07 09:27:06 +02:00
|
|
|
* initializer_list @a __l.
|
2008-07-21 21:40:39 +02:00
|
|
|
* This is linear in N if the range is already sorted, and NlogN
|
2011-08-07 09:27:06 +02:00
|
|
|
* otherwise (where N is @a __l.size()).
|
2008-07-21 21:40:39 +02:00
|
|
|
*/
|
|
|
|
map(initializer_list<value_type> __l,
|
2011-08-07 09:27:06 +02:00
|
|
|
const _Compare& __comp = _Compare(),
|
2008-07-21 21:40:39 +02:00
|
|
|
const allocator_type& __a = allocator_type())
|
re PR libstdc++/50118 (node-based containers cannot use allocators with explicit constructor template)
2011-08-29 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/50118
* include/bits/stl_list.h (_List_base<>::
_List_base(const allocator_type&)): Remove.
(_List_base<>::_List_base(const _Node_alloc_type&)): Add.
(list<>:list(const allocator_type&), list(size_type, const
value_type&, const allocator_type&),
list(initializer_list<, const allocator_type&),
list(_InputIterator, _InputIterator, const allocator_type&),
insert(iterator, size_type, const value_type&),
insert(iterator, _InputIterator, _InputIterator)): Adjust.
* include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(const _Compare&,
const allocator_type&)): Fix.
* include/bits/stl_map.h (map<>::map(const _Compare&,
const allocator_type&), map(initializer_list<>,
const _Compare&, const allocator_type&), map(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Adjust.
* include/bits/stl_set.h (set<>::set(const _Compare&,
const allocator_type&), set(initializer_list<>,
const _Compare&, const allocator_type&), set(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/stl_multimap.h (multimap<>::multimap(const _Compare&,
const allocator_type&), multimap(initializer_list<>,
const _Compare&, const allocator_type&), multimap(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/stl_multiset.h (multiset<>::multiset(const _Compare&,
const allocator_type&), multiset(initializer_list<>,
const _Compare&, const allocator_type&), multiset(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/forward_list.h (_Fwd_list_base<>::
_Fwd_list_base(const _Alloc&), _Fwd_list_base(const _Fwd_list_base&,
const _Alloc&), _Fwd_list_base(_Fwd_list_base&&, const _Alloc&)):
Remove.
(_Fwd_list_base<>::_Fwd_list_base(const _Node_alloc_type&),
_Fwd_list_base(const _Fwd_list_base&,
const _Node_alloc_type&), _Fwd_list_base(_Fwd_list_base&&,
const _Node_alloc_type&)): Add.
(forward_list<>::forward_list(const _Alloc&),
forward_list(const forward_list&, const _Alloc&),
forward_list(forward_list&&, const _Alloc&),
forward_list(size_type, const _Tp&, const _Alloc&),
forward_list(_InputIterator, _InputIterator, const _Alloc&),
forward_list(std::initializer_list<>, const _Alloc&),
get_allocator): Adjust.
* include/bits/forward_list.tcc
* testsuite/util/testsuite_allocator.h (ExplicitConsAlloc): Add.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation/5.cc: New.
* testsuite/23_containers/multimap/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/multimap/requirements/
explicit_instantiation/5_c++0x.cc: Likewise.
* testsuite/23_containers/set/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/set/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation/5.cc: Likewise.
testsuite/23_containers/multiset/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/multiset/requirements/
explicit_instantiation/5_c++0x.cc: Likewise.
* testsuite/23_containers/list/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/list/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/map/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/map/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Adjust dg-error line number.
* 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/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.
From-SVN: r178230
2011-08-29 15:40:33 +02:00
|
|
|
: _M_t(__comp, _Pair_alloc_type(__a))
|
2008-07-21 21:40:39 +02:00
|
|
|
{ _M_t._M_insert_unique(__l.begin(), __l.end()); }
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
#endif
|
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Builds a %map from a range.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __first An input iterator.
|
|
|
|
* @param __last An input iterator.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
2011-08-07 09:27:06 +02:00
|
|
|
* Create a %map consisting of copies of the elements from
|
|
|
|
* [__first,__last). This is linear in N if the range is
|
|
|
|
* already sorted, and NlogN otherwise (where N is
|
|
|
|
* distance(__first,__last)).
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _InputIterator>
|
2004-02-01 18:34:44 +01:00
|
|
|
map(_InputIterator __first, _InputIterator __last)
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
: _M_t()
|
2006-01-06 20:11:06 +01:00
|
|
|
{ _M_t._M_insert_unique(__first, __last); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Builds a %map from a range.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __first An input iterator.
|
|
|
|
* @param __last An input iterator.
|
|
|
|
* @param __comp A comparison functor.
|
|
|
|
* @param __a An allocator object.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
2011-08-07 09:27:06 +02:00
|
|
|
* Create a %map consisting of copies of the elements from
|
|
|
|
* [__first,__last). This is linear in N if the range is
|
|
|
|
* already sorted, and NlogN otherwise (where N is
|
|
|
|
* distance(__first,__last)).
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _InputIterator>
|
2004-02-01 18:34:44 +01:00
|
|
|
map(_InputIterator __first, _InputIterator __last,
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
const _Compare& __comp,
|
|
|
|
const allocator_type& __a = allocator_type())
|
re PR libstdc++/50118 (node-based containers cannot use allocators with explicit constructor template)
2011-08-29 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/50118
* include/bits/stl_list.h (_List_base<>::
_List_base(const allocator_type&)): Remove.
(_List_base<>::_List_base(const _Node_alloc_type&)): Add.
(list<>:list(const allocator_type&), list(size_type, const
value_type&, const allocator_type&),
list(initializer_list<, const allocator_type&),
list(_InputIterator, _InputIterator, const allocator_type&),
insert(iterator, size_type, const value_type&),
insert(iterator, _InputIterator, _InputIterator)): Adjust.
* include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(const _Compare&,
const allocator_type&)): Fix.
* include/bits/stl_map.h (map<>::map(const _Compare&,
const allocator_type&), map(initializer_list<>,
const _Compare&, const allocator_type&), map(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Adjust.
* include/bits/stl_set.h (set<>::set(const _Compare&,
const allocator_type&), set(initializer_list<>,
const _Compare&, const allocator_type&), set(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/stl_multimap.h (multimap<>::multimap(const _Compare&,
const allocator_type&), multimap(initializer_list<>,
const _Compare&, const allocator_type&), multimap(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/stl_multiset.h (multiset<>::multiset(const _Compare&,
const allocator_type&), multiset(initializer_list<>,
const _Compare&, const allocator_type&), multiset(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/forward_list.h (_Fwd_list_base<>::
_Fwd_list_base(const _Alloc&), _Fwd_list_base(const _Fwd_list_base&,
const _Alloc&), _Fwd_list_base(_Fwd_list_base&&, const _Alloc&)):
Remove.
(_Fwd_list_base<>::_Fwd_list_base(const _Node_alloc_type&),
_Fwd_list_base(const _Fwd_list_base&,
const _Node_alloc_type&), _Fwd_list_base(_Fwd_list_base&&,
const _Node_alloc_type&)): Add.
(forward_list<>::forward_list(const _Alloc&),
forward_list(const forward_list&, const _Alloc&),
forward_list(forward_list&&, const _Alloc&),
forward_list(size_type, const _Tp&, const _Alloc&),
forward_list(_InputIterator, _InputIterator, const _Alloc&),
forward_list(std::initializer_list<>, const _Alloc&),
get_allocator): Adjust.
* include/bits/forward_list.tcc
* testsuite/util/testsuite_allocator.h (ExplicitConsAlloc): Add.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation/5.cc: New.
* testsuite/23_containers/multimap/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/multimap/requirements/
explicit_instantiation/5_c++0x.cc: Likewise.
* testsuite/23_containers/set/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/set/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation/5.cc: Likewise.
testsuite/23_containers/multiset/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/multiset/requirements/
explicit_instantiation/5_c++0x.cc: Likewise.
* testsuite/23_containers/list/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/list/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/map/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/map/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Adjust dg-error line number.
* 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/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.
From-SVN: r178230
2011-08-29 15:40:33 +02:00
|
|
|
: _M_t(__comp, _Pair_alloc_type(__a))
|
2006-01-06 20:11:06 +01:00
|
|
|
{ _M_t._M_insert_unique(__first, __last); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2006-02-22 01:57:24 +01:00
|
|
|
// FIXME There is no dtor declared, but we should have something
|
|
|
|
// generated by Doxygen. I don't know what tags to add to this
|
|
|
|
// paragraph to make that happen:
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* The dtor only erases the elements, and note that if the elements
|
|
|
|
* themselves are pointers, the pointed-to memory is not touched in any
|
2008-01-31 19:44:55 +01:00
|
|
|
* way. Managing the pointer is the user's responsibility.
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
* @brief %Map assignment operator.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x A %map of identical element and allocator types.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
2011-08-07 09:27:06 +02:00
|
|
|
* All the elements of @a __x are copied, but unlike the copy
|
|
|
|
* constructor, the allocator object is not copied.
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
|
|
|
map&
|
|
|
|
operator=(const map& __x)
|
|
|
|
{
|
|
|
|
_M_t = __x._M_t;
|
|
|
|
return *this;
|
|
|
|
}
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
/**
|
|
|
|
* @brief %Map move assignment operator.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x A %map of identical element and allocator types.
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
*
|
2011-08-07 09:27:06 +02:00
|
|
|
* The contents of @a __x are moved into this map (without copying).
|
|
|
|
* @a __x is a valid, but unspecified %map.
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
*/
|
|
|
|
map&
|
|
|
|
operator=(map&& __x)
|
|
|
|
{
|
2010-01-09 12:16:42 +01:00
|
|
|
// NB: DR 1204.
|
|
|
|
// NB: DR 675.
|
|
|
|
this->clear();
|
|
|
|
this->swap(__x);
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
return *this;
|
|
|
|
}
|
2008-07-21 21:40:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief %Map list assignment operator.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __l An initializer_list.
|
2008-07-21 21:40:39 +02:00
|
|
|
*
|
|
|
|
* This function fills a %map with copies of the elements in the
|
2011-08-07 09:27:06 +02:00
|
|
|
* initializer list @a __l.
|
2008-07-21 21:40:39 +02:00
|
|
|
*
|
|
|
|
* Note that the assignment completely changes the %map and
|
|
|
|
* that the resulting %map's size is the same as the number
|
|
|
|
* of elements assigned. Old data may be lost.
|
|
|
|
*/
|
|
|
|
map&
|
|
|
|
operator=(initializer_list<value_type> __l)
|
|
|
|
{
|
|
|
|
this->clear();
|
|
|
|
this->insert(__l.begin(), __l.end());
|
|
|
|
return *this;
|
|
|
|
}
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
#endif
|
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/// Get a copy of the memory allocation object.
|
|
|
|
allocator_type
|
2011-05-26 17:35:02 +02:00
|
|
|
get_allocator() const _GLIBCXX_NOEXCEPT
|
re PR libstdc++/50118 (node-based containers cannot use allocators with explicit constructor template)
2011-08-29 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/50118
* include/bits/stl_list.h (_List_base<>::
_List_base(const allocator_type&)): Remove.
(_List_base<>::_List_base(const _Node_alloc_type&)): Add.
(list<>:list(const allocator_type&), list(size_type, const
value_type&, const allocator_type&),
list(initializer_list<, const allocator_type&),
list(_InputIterator, _InputIterator, const allocator_type&),
insert(iterator, size_type, const value_type&),
insert(iterator, _InputIterator, _InputIterator)): Adjust.
* include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(const _Compare&,
const allocator_type&)): Fix.
* include/bits/stl_map.h (map<>::map(const _Compare&,
const allocator_type&), map(initializer_list<>,
const _Compare&, const allocator_type&), map(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Adjust.
* include/bits/stl_set.h (set<>::set(const _Compare&,
const allocator_type&), set(initializer_list<>,
const _Compare&, const allocator_type&), set(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/stl_multimap.h (multimap<>::multimap(const _Compare&,
const allocator_type&), multimap(initializer_list<>,
const _Compare&, const allocator_type&), multimap(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/stl_multiset.h (multiset<>::multiset(const _Compare&,
const allocator_type&), multiset(initializer_list<>,
const _Compare&, const allocator_type&), multiset(_InputIterator,
_InputIterator, const _Compare&, const allocator_type&),
get_allocator): Likewise.
* include/bits/forward_list.h (_Fwd_list_base<>::
_Fwd_list_base(const _Alloc&), _Fwd_list_base(const _Fwd_list_base&,
const _Alloc&), _Fwd_list_base(_Fwd_list_base&&, const _Alloc&)):
Remove.
(_Fwd_list_base<>::_Fwd_list_base(const _Node_alloc_type&),
_Fwd_list_base(const _Fwd_list_base&,
const _Node_alloc_type&), _Fwd_list_base(_Fwd_list_base&&,
const _Node_alloc_type&)): Add.
(forward_list<>::forward_list(const _Alloc&),
forward_list(const forward_list&, const _Alloc&),
forward_list(forward_list&&, const _Alloc&),
forward_list(size_type, const _Tp&, const _Alloc&),
forward_list(_InputIterator, _InputIterator, const _Alloc&),
forward_list(std::initializer_list<>, const _Alloc&),
get_allocator): Adjust.
* include/bits/forward_list.tcc
* testsuite/util/testsuite_allocator.h (ExplicitConsAlloc): Add.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation/5.cc: New.
* testsuite/23_containers/multimap/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/multimap/requirements/
explicit_instantiation/5_c++0x.cc: Likewise.
* testsuite/23_containers/set/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/set/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation/5.cc: Likewise.
testsuite/23_containers/multiset/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/multiset/requirements/
explicit_instantiation/5_c++0x.cc: Likewise.
* testsuite/23_containers/list/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/list/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation/5.cc: Likewise.
* testsuite/23_containers/map/requirements/explicit_instantiation/
5.cc: Likewise.
* testsuite/23_containers/map/requirements/explicit_instantiation/
5_c++0x.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Adjust dg-error line number.
* 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/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.
From-SVN: r178230
2011-08-29 15:40:33 +02:00
|
|
|
{ return allocator_type(_M_t.get_allocator()); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
// iterators
|
|
|
|
/**
|
2004-02-08 05:46:42 +01:00
|
|
|
* Returns a read/write iterator that points to the first pair in the
|
2004-02-01 18:34:44 +01:00
|
|
|
* %map.
|
|
|
|
* Iteration is done in ascending order according to the keys.
|
|
|
|
*/
|
|
|
|
iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
begin() _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.begin(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* Returns a read-only (constant) iterator that points to the first pair
|
|
|
|
* in the %map. Iteration is done in ascending order according to the
|
|
|
|
* keys.
|
|
|
|
*/
|
|
|
|
const_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
begin() const _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.begin(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
2006-02-22 01:57:24 +01:00
|
|
|
* Returns a read/write iterator that points one past the last
|
|
|
|
* pair in the %map. Iteration is done in ascending order
|
|
|
|
* according to the keys.
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
|
|
|
iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
end() _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.end(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* Returns a read-only (constant) iterator that points one past the last
|
|
|
|
* pair in the %map. Iteration is done in ascending order according to
|
|
|
|
* the keys.
|
|
|
|
*/
|
|
|
|
const_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
end() const _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.end(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* Returns a read/write reverse iterator that points to the last pair in
|
|
|
|
* the %map. Iteration is done in descending order according to the
|
|
|
|
* keys.
|
|
|
|
*/
|
|
|
|
reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
rbegin() _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.rbegin(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* Returns a read-only (constant) reverse iterator that points to the
|
|
|
|
* last pair in the %map. Iteration is done in descending order
|
|
|
|
* according to the keys.
|
|
|
|
*/
|
|
|
|
const_reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
rbegin() const _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.rbegin(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* Returns a read/write reverse iterator that points to one before the
|
|
|
|
* first pair in the %map. Iteration is done in descending order
|
|
|
|
* according to the keys.
|
|
|
|
*/
|
|
|
|
reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
rend() _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.rend(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* Returns a read-only (constant) reverse iterator that points to one
|
|
|
|
* before the first pair in the %map. Iteration is done in descending
|
|
|
|
* order according to the keys.
|
|
|
|
*/
|
|
|
|
const_reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
rend() const _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.rend(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
set.h (set<>::cbegin, [...]): Add.
2007-10-15 Paolo Carlini <pcarlini@suse.de>
* include/debug/set.h (set<>::cbegin, cend, crbegin, crend): Add.
* include/debug/multiset.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/vector (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/deque (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/list (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/array (array<>::cbegin, cend, crbegin, crend):
Likewise.
* include/ext/vstring.h (__versa_string<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_list.h (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_set.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_vector.h (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_deque.h (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multiset.h (multiset<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_bvector.h (vector<bool>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/hashtable (_Hashtable<>::cbegin, cend): Add.
* testsuite/ext/vstring/requirements/citerators.cc: Add.
* testsuite/23_containers/unordered_map/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/multimap/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/set/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multimap/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/unordered_set/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/vector/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/bool/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/deque/requirements/citerators.cc: Likewise.
* testsuite/23_containers/multiset/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/list/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multiset/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/map/requirements/citerators.cc: Likewise.
* testsuite/23_containers/array/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error lines.
* 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.
From-SVN: r129370
2007-10-15 22:51:53 +02:00
|
|
|
/**
|
|
|
|
* Returns a read-only (constant) iterator that points to the first pair
|
|
|
|
* in the %map. Iteration is done in ascending order according to the
|
|
|
|
* keys.
|
|
|
|
*/
|
|
|
|
const_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
cbegin() const noexcept
|
set.h (set<>::cbegin, [...]): Add.
2007-10-15 Paolo Carlini <pcarlini@suse.de>
* include/debug/set.h (set<>::cbegin, cend, crbegin, crend): Add.
* include/debug/multiset.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/vector (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/deque (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/list (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/array (array<>::cbegin, cend, crbegin, crend):
Likewise.
* include/ext/vstring.h (__versa_string<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_list.h (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_set.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_vector.h (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_deque.h (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multiset.h (multiset<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_bvector.h (vector<bool>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/hashtable (_Hashtable<>::cbegin, cend): Add.
* testsuite/ext/vstring/requirements/citerators.cc: Add.
* testsuite/23_containers/unordered_map/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/multimap/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/set/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multimap/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/unordered_set/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/vector/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/bool/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/deque/requirements/citerators.cc: Likewise.
* testsuite/23_containers/multiset/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/list/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multiset/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/map/requirements/citerators.cc: Likewise.
* testsuite/23_containers/array/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error lines.
* 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.
From-SVN: r129370
2007-10-15 22:51:53 +02:00
|
|
|
{ return _M_t.begin(); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a read-only (constant) iterator that points one past the last
|
|
|
|
* pair in the %map. Iteration is done in ascending order according to
|
|
|
|
* the keys.
|
|
|
|
*/
|
|
|
|
const_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
cend() const noexcept
|
set.h (set<>::cbegin, [...]): Add.
2007-10-15 Paolo Carlini <pcarlini@suse.de>
* include/debug/set.h (set<>::cbegin, cend, crbegin, crend): Add.
* include/debug/multiset.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/vector (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/deque (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/list (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/array (array<>::cbegin, cend, crbegin, crend):
Likewise.
* include/ext/vstring.h (__versa_string<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_list.h (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_set.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_vector.h (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_deque.h (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multiset.h (multiset<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_bvector.h (vector<bool>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/hashtable (_Hashtable<>::cbegin, cend): Add.
* testsuite/ext/vstring/requirements/citerators.cc: Add.
* testsuite/23_containers/unordered_map/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/multimap/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/set/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multimap/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/unordered_set/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/vector/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/bool/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/deque/requirements/citerators.cc: Likewise.
* testsuite/23_containers/multiset/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/list/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multiset/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/map/requirements/citerators.cc: Likewise.
* testsuite/23_containers/array/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error lines.
* 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.
From-SVN: r129370
2007-10-15 22:51:53 +02:00
|
|
|
{ return _M_t.end(); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a read-only (constant) reverse iterator that points to the
|
|
|
|
* last pair in the %map. Iteration is done in descending order
|
|
|
|
* according to the keys.
|
|
|
|
*/
|
|
|
|
const_reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
crbegin() const noexcept
|
set.h (set<>::cbegin, [...]): Add.
2007-10-15 Paolo Carlini <pcarlini@suse.de>
* include/debug/set.h (set<>::cbegin, cend, crbegin, crend): Add.
* include/debug/multiset.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/vector (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/deque (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/list (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/array (array<>::cbegin, cend, crbegin, crend):
Likewise.
* include/ext/vstring.h (__versa_string<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_list.h (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_set.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_vector.h (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_deque.h (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multiset.h (multiset<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_bvector.h (vector<bool>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/hashtable (_Hashtable<>::cbegin, cend): Add.
* testsuite/ext/vstring/requirements/citerators.cc: Add.
* testsuite/23_containers/unordered_map/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/multimap/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/set/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multimap/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/unordered_set/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/vector/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/bool/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/deque/requirements/citerators.cc: Likewise.
* testsuite/23_containers/multiset/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/list/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multiset/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/map/requirements/citerators.cc: Likewise.
* testsuite/23_containers/array/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error lines.
* 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.
From-SVN: r129370
2007-10-15 22:51:53 +02:00
|
|
|
{ return _M_t.rbegin(); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a read-only (constant) reverse iterator that points to one
|
|
|
|
* before the first pair in the %map. Iteration is done in descending
|
|
|
|
* order according to the keys.
|
|
|
|
*/
|
|
|
|
const_reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
crend() const noexcept
|
set.h (set<>::cbegin, [...]): Add.
2007-10-15 Paolo Carlini <pcarlini@suse.de>
* include/debug/set.h (set<>::cbegin, cend, crbegin, crend): Add.
* include/debug/multiset.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/vector (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/deque (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/list (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/array (array<>::cbegin, cend, crbegin, crend):
Likewise.
* include/ext/vstring.h (__versa_string<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_list.h (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_set.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_vector.h (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_deque.h (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multiset.h (multiset<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_bvector.h (vector<bool>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/hashtable (_Hashtable<>::cbegin, cend): Add.
* testsuite/ext/vstring/requirements/citerators.cc: Add.
* testsuite/23_containers/unordered_map/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/multimap/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/set/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multimap/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/unordered_set/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/vector/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/bool/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/deque/requirements/citerators.cc: Likewise.
* testsuite/23_containers/multiset/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/list/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multiset/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/map/requirements/citerators.cc: Likewise.
* testsuite/23_containers/array/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error lines.
* 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.
From-SVN: r129370
2007-10-15 22:51:53 +02:00
|
|
|
{ return _M_t.rend(); }
|
|
|
|
#endif
|
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
// capacity
|
|
|
|
/** Returns true if the %map is empty. (Thus begin() would equal
|
|
|
|
* end().)
|
|
|
|
*/
|
|
|
|
bool
|
2011-05-26 17:35:02 +02:00
|
|
|
empty() const _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.empty(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/** Returns the size of the %map. */
|
|
|
|
size_type
|
2011-05-26 17:35:02 +02:00
|
|
|
size() const _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.size(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/** Returns the maximum size of the %map. */
|
|
|
|
size_type
|
2011-05-26 17:35:02 +02:00
|
|
|
max_size() const _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ return _M_t.max_size(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
// [23.3.1.2] element access
|
|
|
|
/**
|
|
|
|
* @brief Subscript ( @c [] ) access to %map data.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __k The key for which data should be retrieved.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return A reference to the data of the (key,data) %pair.
|
|
|
|
*
|
2006-02-22 01:57:24 +01:00
|
|
|
* Allows for easy lookup with the subscript ( @c [] )
|
|
|
|
* operator. Returns data associated with the key specified in
|
|
|
|
* subscript. If the key does not exist, a pair with that key
|
|
|
|
* is created using default values, which is then returned.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
|
|
|
* Lookup requires logarithmic time.
|
|
|
|
*/
|
|
|
|
mapped_type&
|
|
|
|
operator[](const key_type& __k)
|
|
|
|
{
|
|
|
|
// concept requirements
|
|
|
|
__glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
iterator __i = lower_bound(__k);
|
|
|
|
// __i->first is greater than or equivalent to __k.
|
|
|
|
if (__i == end() || key_comp()(__k, (*__i).first))
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
re PR libstdc++/44436 ([C++0x] Implement emplace* in associative containers)
2012-09-24 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/44436
* include/bits/stl_tree.h
(_Rb_tree<>::_M_insert_): Take _Base_ptr rather than
_Const_Base_ptr.
(_Rb_tree<>::_M_insert_node): New.
(_Rb_tree<>::_M_get_insert_unique_pos): New, search code of
_M_insert_unique method.
(_Rb_tree<>::_M_insert_unique): Use latter.
(_Rb_tree<>::_M_emplace_unique): New, likewise.
(_Rb_tree<>::_M_get_insert_equal_pos): New, search code of
_M_insert_equal method.
(_Rb_tree<>::_M_insert_equal): Use latter.
(_Rb_tree<>::_M_emplace_equal): New, likewise.
(_Rb_tree<>::_M_get_insert_hint_unique_pos): New, search code of
_M_insert_unique_ method.
(_Rb_tree<>::_M_insert_unique_): Use latter.
(_Rb_tree<>::_M_emplace_hint_unique): New, likewise.
(_Rb_tree<>::_M_get_insert_hint_equal_pos): New, search code of
_M_insert_equal_ method.
(_Rb_tree<>::_M_insert_equal_): Use latter.
(_Rb_tree<>::_M_emplace_hint_equal): New, likewise.
(_Rb_tree<>::_M_insert_lower): Remove first _Base_ptr parameter,
useless as always null.
* include/bits/stl_map.h: Include <tuple> in C++11.
(map<>::operator[](const key_type&)): Use
_Rb_tree<>::_M_emplace_hint_unique in C++11.
(map<>::operator[](key_type&&)): Likewise.
(map<>::emplace): New.
(map<>::emplace_hint): New.
* include/bits/stl_multimap.h (multimap<>::emplace): New.
(multimap<>::emplace_hint): New.
* include/bits/stl_set.h (set<>::emplace): New.
(set<>::emplace_hint): New.
* include/bits/stl_multiset.h (multiset<>::emplace): New.
(multiset<>::emplace_hint): New.
* include/debug/map.h (std::__debug::map<>::emplace): New.
(std::__debug::map<>::emplace_hint): New.
* include/debug/multimap.h (std::__debug::multimap<>::emplace):
New.
(std::__debug::multimap<>::emplace_hint): New.
* include/debug/set.h (std::__debug::set<>::emplace): New.
(std::__debug::set<>::emplace_hint): New.
* include/debug/multiset.h (std::__debug::multiset<>::emplace):
New.
(std::__debug::multiset<>::emplace_hint): New.
* include/profile/map.h (std::__profile::map<>::emplace): New.
(std::__profile::map<>::emplace_hint): New.
* include/profile/multimap.h (std::__profile::multimap<>::emplace):
New.
(std::__profile::multimap<>::emplace_hint): New.
* include/profile/set.h (std::__profile::set<>::emplace): New.
(std::__profile::set<>::emplace_hint): New.
* include/profile/multiset.h (std::__profile::multiset<>::emplace):
New.
(std::__profile::multiset<>::emplace_hint): New.
* testsuite/util/testsuite_container_traits.h: Signal that emplace
and emplace_hint are available on std::map, std::multimap,
std::set and std::multiset in C++11.
* testsuite/23_containers/map/operators/2.cc: New.
* testsuite/23_containers/map/modifiers/emplace/1.cc: New.
* testsuite/23_containers/multimap/modifiers/emplace/1.cc: New.
* testsuite/23_containers/set/modifiers/emplace/1.cc: New.
* testsuite/23_containers/multiset/modifiers/emplace/1.cc: New.
From-SVN: r191679
2012-09-24 21:53:36 +02:00
|
|
|
__i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
|
|
|
|
std::tuple<const key_type&>(__k),
|
|
|
|
std::tuple<>());
|
|
|
|
#else
|
2004-02-03 18:59:05 +01:00
|
|
|
__i = insert(__i, value_type(__k, mapped_type()));
|
re PR libstdc++/44436 ([C++0x] Implement emplace* in associative containers)
2012-09-24 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/44436
* include/bits/stl_tree.h
(_Rb_tree<>::_M_insert_): Take _Base_ptr rather than
_Const_Base_ptr.
(_Rb_tree<>::_M_insert_node): New.
(_Rb_tree<>::_M_get_insert_unique_pos): New, search code of
_M_insert_unique method.
(_Rb_tree<>::_M_insert_unique): Use latter.
(_Rb_tree<>::_M_emplace_unique): New, likewise.
(_Rb_tree<>::_M_get_insert_equal_pos): New, search code of
_M_insert_equal method.
(_Rb_tree<>::_M_insert_equal): Use latter.
(_Rb_tree<>::_M_emplace_equal): New, likewise.
(_Rb_tree<>::_M_get_insert_hint_unique_pos): New, search code of
_M_insert_unique_ method.
(_Rb_tree<>::_M_insert_unique_): Use latter.
(_Rb_tree<>::_M_emplace_hint_unique): New, likewise.
(_Rb_tree<>::_M_get_insert_hint_equal_pos): New, search code of
_M_insert_equal_ method.
(_Rb_tree<>::_M_insert_equal_): Use latter.
(_Rb_tree<>::_M_emplace_hint_equal): New, likewise.
(_Rb_tree<>::_M_insert_lower): Remove first _Base_ptr parameter,
useless as always null.
* include/bits/stl_map.h: Include <tuple> in C++11.
(map<>::operator[](const key_type&)): Use
_Rb_tree<>::_M_emplace_hint_unique in C++11.
(map<>::operator[](key_type&&)): Likewise.
(map<>::emplace): New.
(map<>::emplace_hint): New.
* include/bits/stl_multimap.h (multimap<>::emplace): New.
(multimap<>::emplace_hint): New.
* include/bits/stl_set.h (set<>::emplace): New.
(set<>::emplace_hint): New.
* include/bits/stl_multiset.h (multiset<>::emplace): New.
(multiset<>::emplace_hint): New.
* include/debug/map.h (std::__debug::map<>::emplace): New.
(std::__debug::map<>::emplace_hint): New.
* include/debug/multimap.h (std::__debug::multimap<>::emplace):
New.
(std::__debug::multimap<>::emplace_hint): New.
* include/debug/set.h (std::__debug::set<>::emplace): New.
(std::__debug::set<>::emplace_hint): New.
* include/debug/multiset.h (std::__debug::multiset<>::emplace):
New.
(std::__debug::multiset<>::emplace_hint): New.
* include/profile/map.h (std::__profile::map<>::emplace): New.
(std::__profile::map<>::emplace_hint): New.
* include/profile/multimap.h (std::__profile::multimap<>::emplace):
New.
(std::__profile::multimap<>::emplace_hint): New.
* include/profile/set.h (std::__profile::set<>::emplace): New.
(std::__profile::set<>::emplace_hint): New.
* include/profile/multiset.h (std::__profile::multiset<>::emplace):
New.
(std::__profile::multiset<>::emplace_hint): New.
* testsuite/util/testsuite_container_traits.h: Signal that emplace
and emplace_hint are available on std::map, std::multimap,
std::set and std::multiset in C++11.
* testsuite/23_containers/map/operators/2.cc: New.
* testsuite/23_containers/map/modifiers/emplace/1.cc: New.
* testsuite/23_containers/multimap/modifiers/emplace/1.cc: New.
* testsuite/23_containers/set/modifiers/emplace/1.cc: New.
* testsuite/23_containers/multiset/modifiers/emplace/1.cc: New.
From-SVN: r191679
2012-09-24 21:53:36 +02:00
|
|
|
#endif
|
2004-02-01 18:34:44 +01:00
|
|
|
return (*__i).second;
|
|
|
|
}
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
PR libstdc++/44436 (partial)
2010-11-10 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44436 (partial)
PR libstdc++/46148
* include/bits/stl_tree.h (_Rb_tree<>::_M_insert_, _M_insert_lower,
_M_insert_equal_lower, _M_insert_unique, _M_insert_equal,
_M_insert_unique_, _M_insert_equal_): Templatize in C++0x mode,
use _GLIBCXX_FORWARD throughout.
* include/bits/stl_map.h (map<>::insert(_Pair&&),
insert(const_iterator, _Pair&&), operator[](key_type&&): Add.
* include/bits/stl_set.h (set<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/bits/stl_multimap.h (multimap<>::insert(_Pair&&),
insert(const_iterator, _Pair&&)): Likewise.
* include/bits/stl_multiset.h (multiset<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/debug/set.h: Adjust.
* include/debug/multiset.h: Likewise.
* include/debug/map.h: Likewise.
* include/debug/multimap.h: Likewise.
* include/profile/set.h: Likewise.
* include/profile/multiset.h: Likewise.
* include/profile/map.h: Likewise.
* include/profile/multimap.h: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/1.cc: New.
* testsuite/23_containers/multimap/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/5.cc: Likewise.
* testsuite/23_containers/map/element_access/2.cc: Likewise.
* testsuite/23_containers/map/element_access/46148.cc: Likewise.
* include/bits/hashtable.h: Trivial naming changes.
From-SVN: r166551
2010-11-10 20:08:49 +01:00
|
|
|
mapped_type&
|
|
|
|
operator[](key_type&& __k)
|
|
|
|
{
|
|
|
|
// concept requirements
|
|
|
|
__glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
|
|
|
|
|
|
|
|
iterator __i = lower_bound(__k);
|
|
|
|
// __i->first is greater than or equivalent to __k.
|
|
|
|
if (__i == end() || key_comp()(__k, (*__i).first))
|
re PR libstdc++/44436 ([C++0x] Implement emplace* in associative containers)
2012-09-24 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/44436
* include/bits/stl_tree.h
(_Rb_tree<>::_M_insert_): Take _Base_ptr rather than
_Const_Base_ptr.
(_Rb_tree<>::_M_insert_node): New.
(_Rb_tree<>::_M_get_insert_unique_pos): New, search code of
_M_insert_unique method.
(_Rb_tree<>::_M_insert_unique): Use latter.
(_Rb_tree<>::_M_emplace_unique): New, likewise.
(_Rb_tree<>::_M_get_insert_equal_pos): New, search code of
_M_insert_equal method.
(_Rb_tree<>::_M_insert_equal): Use latter.
(_Rb_tree<>::_M_emplace_equal): New, likewise.
(_Rb_tree<>::_M_get_insert_hint_unique_pos): New, search code of
_M_insert_unique_ method.
(_Rb_tree<>::_M_insert_unique_): Use latter.
(_Rb_tree<>::_M_emplace_hint_unique): New, likewise.
(_Rb_tree<>::_M_get_insert_hint_equal_pos): New, search code of
_M_insert_equal_ method.
(_Rb_tree<>::_M_insert_equal_): Use latter.
(_Rb_tree<>::_M_emplace_hint_equal): New, likewise.
(_Rb_tree<>::_M_insert_lower): Remove first _Base_ptr parameter,
useless as always null.
* include/bits/stl_map.h: Include <tuple> in C++11.
(map<>::operator[](const key_type&)): Use
_Rb_tree<>::_M_emplace_hint_unique in C++11.
(map<>::operator[](key_type&&)): Likewise.
(map<>::emplace): New.
(map<>::emplace_hint): New.
* include/bits/stl_multimap.h (multimap<>::emplace): New.
(multimap<>::emplace_hint): New.
* include/bits/stl_set.h (set<>::emplace): New.
(set<>::emplace_hint): New.
* include/bits/stl_multiset.h (multiset<>::emplace): New.
(multiset<>::emplace_hint): New.
* include/debug/map.h (std::__debug::map<>::emplace): New.
(std::__debug::map<>::emplace_hint): New.
* include/debug/multimap.h (std::__debug::multimap<>::emplace):
New.
(std::__debug::multimap<>::emplace_hint): New.
* include/debug/set.h (std::__debug::set<>::emplace): New.
(std::__debug::set<>::emplace_hint): New.
* include/debug/multiset.h (std::__debug::multiset<>::emplace):
New.
(std::__debug::multiset<>::emplace_hint): New.
* include/profile/map.h (std::__profile::map<>::emplace): New.
(std::__profile::map<>::emplace_hint): New.
* include/profile/multimap.h (std::__profile::multimap<>::emplace):
New.
(std::__profile::multimap<>::emplace_hint): New.
* include/profile/set.h (std::__profile::set<>::emplace): New.
(std::__profile::set<>::emplace_hint): New.
* include/profile/multiset.h (std::__profile::multiset<>::emplace):
New.
(std::__profile::multiset<>::emplace_hint): New.
* testsuite/util/testsuite_container_traits.h: Signal that emplace
and emplace_hint are available on std::map, std::multimap,
std::set and std::multiset in C++11.
* testsuite/23_containers/map/operators/2.cc: New.
* testsuite/23_containers/map/modifiers/emplace/1.cc: New.
* testsuite/23_containers/multimap/modifiers/emplace/1.cc: New.
* testsuite/23_containers/set/modifiers/emplace/1.cc: New.
* testsuite/23_containers/multiset/modifiers/emplace/1.cc: New.
From-SVN: r191679
2012-09-24 21:53:36 +02:00
|
|
|
__i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
|
|
|
|
std::forward_as_tuple(std::move(__k)),
|
|
|
|
std::tuple<>());
|
PR libstdc++/44436 (partial)
2010-11-10 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44436 (partial)
PR libstdc++/46148
* include/bits/stl_tree.h (_Rb_tree<>::_M_insert_, _M_insert_lower,
_M_insert_equal_lower, _M_insert_unique, _M_insert_equal,
_M_insert_unique_, _M_insert_equal_): Templatize in C++0x mode,
use _GLIBCXX_FORWARD throughout.
* include/bits/stl_map.h (map<>::insert(_Pair&&),
insert(const_iterator, _Pair&&), operator[](key_type&&): Add.
* include/bits/stl_set.h (set<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/bits/stl_multimap.h (multimap<>::insert(_Pair&&),
insert(const_iterator, _Pair&&)): Likewise.
* include/bits/stl_multiset.h (multiset<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/debug/set.h: Adjust.
* include/debug/multiset.h: Likewise.
* include/debug/map.h: Likewise.
* include/debug/multimap.h: Likewise.
* include/profile/set.h: Likewise.
* include/profile/multiset.h: Likewise.
* include/profile/map.h: Likewise.
* include/profile/multimap.h: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/1.cc: New.
* testsuite/23_containers/multimap/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/5.cc: Likewise.
* testsuite/23_containers/map/element_access/2.cc: Likewise.
* testsuite/23_containers/map/element_access/46148.cc: Likewise.
* include/bits/hashtable.h: Trivial naming changes.
From-SVN: r166551
2010-11-10 20:08:49 +01:00
|
|
|
return (*__i).second;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-08-29 18:11:19 +02:00
|
|
|
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
|
|
|
// DR 464. Suggestion for new member functions in standard containers.
|
|
|
|
/**
|
|
|
|
* @brief Access to %map data.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __k The key for which data should be retrieved.
|
|
|
|
* @return A reference to the data whose key is equivalent to @a __k, if
|
2005-08-29 18:47:06 +02:00
|
|
|
* such a data is present in the %map.
|
2005-08-29 18:11:19 +02:00
|
|
|
* @throw std::out_of_range If no such data is present.
|
|
|
|
*/
|
|
|
|
mapped_type&
|
|
|
|
at(const key_type& __k)
|
|
|
|
{
|
|
|
|
iterator __i = lower_bound(__k);
|
|
|
|
if (__i == end() || key_comp()(__k, (*__i).first))
|
|
|
|
__throw_out_of_range(__N("map::at"));
|
|
|
|
return (*__i).second;
|
|
|
|
}
|
|
|
|
|
|
|
|
const mapped_type&
|
|
|
|
at(const key_type& __k) const
|
|
|
|
{
|
|
|
|
const_iterator __i = lower_bound(__k);
|
|
|
|
if (__i == end() || key_comp()(__k, (*__i).first))
|
|
|
|
__throw_out_of_range(__N("map::at"));
|
|
|
|
return (*__i).second;
|
|
|
|
}
|
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
// modifiers
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
re PR libstdc++/44436 ([C++0x] Implement emplace* in associative containers)
2012-09-24 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/44436
* include/bits/stl_tree.h
(_Rb_tree<>::_M_insert_): Take _Base_ptr rather than
_Const_Base_ptr.
(_Rb_tree<>::_M_insert_node): New.
(_Rb_tree<>::_M_get_insert_unique_pos): New, search code of
_M_insert_unique method.
(_Rb_tree<>::_M_insert_unique): Use latter.
(_Rb_tree<>::_M_emplace_unique): New, likewise.
(_Rb_tree<>::_M_get_insert_equal_pos): New, search code of
_M_insert_equal method.
(_Rb_tree<>::_M_insert_equal): Use latter.
(_Rb_tree<>::_M_emplace_equal): New, likewise.
(_Rb_tree<>::_M_get_insert_hint_unique_pos): New, search code of
_M_insert_unique_ method.
(_Rb_tree<>::_M_insert_unique_): Use latter.
(_Rb_tree<>::_M_emplace_hint_unique): New, likewise.
(_Rb_tree<>::_M_get_insert_hint_equal_pos): New, search code of
_M_insert_equal_ method.
(_Rb_tree<>::_M_insert_equal_): Use latter.
(_Rb_tree<>::_M_emplace_hint_equal): New, likewise.
(_Rb_tree<>::_M_insert_lower): Remove first _Base_ptr parameter,
useless as always null.
* include/bits/stl_map.h: Include <tuple> in C++11.
(map<>::operator[](const key_type&)): Use
_Rb_tree<>::_M_emplace_hint_unique in C++11.
(map<>::operator[](key_type&&)): Likewise.
(map<>::emplace): New.
(map<>::emplace_hint): New.
* include/bits/stl_multimap.h (multimap<>::emplace): New.
(multimap<>::emplace_hint): New.
* include/bits/stl_set.h (set<>::emplace): New.
(set<>::emplace_hint): New.
* include/bits/stl_multiset.h (multiset<>::emplace): New.
(multiset<>::emplace_hint): New.
* include/debug/map.h (std::__debug::map<>::emplace): New.
(std::__debug::map<>::emplace_hint): New.
* include/debug/multimap.h (std::__debug::multimap<>::emplace):
New.
(std::__debug::multimap<>::emplace_hint): New.
* include/debug/set.h (std::__debug::set<>::emplace): New.
(std::__debug::set<>::emplace_hint): New.
* include/debug/multiset.h (std::__debug::multiset<>::emplace):
New.
(std::__debug::multiset<>::emplace_hint): New.
* include/profile/map.h (std::__profile::map<>::emplace): New.
(std::__profile::map<>::emplace_hint): New.
* include/profile/multimap.h (std::__profile::multimap<>::emplace):
New.
(std::__profile::multimap<>::emplace_hint): New.
* include/profile/set.h (std::__profile::set<>::emplace): New.
(std::__profile::set<>::emplace_hint): New.
* include/profile/multiset.h (std::__profile::multiset<>::emplace):
New.
(std::__profile::multiset<>::emplace_hint): New.
* testsuite/util/testsuite_container_traits.h: Signal that emplace
and emplace_hint are available on std::map, std::multimap,
std::set and std::multiset in C++11.
* testsuite/23_containers/map/operators/2.cc: New.
* testsuite/23_containers/map/modifiers/emplace/1.cc: New.
* testsuite/23_containers/multimap/modifiers/emplace/1.cc: New.
* testsuite/23_containers/set/modifiers/emplace/1.cc: New.
* testsuite/23_containers/multiset/modifiers/emplace/1.cc: New.
From-SVN: r191679
2012-09-24 21:53:36 +02:00
|
|
|
/**
|
|
|
|
* @brief Attempts to build and insert a std::pair into the %map.
|
|
|
|
*
|
|
|
|
* @param __args Arguments used to generate a new pair instance (see
|
|
|
|
* std::piecewise_contruct for passing arguments to each
|
|
|
|
* part of the pair constructor).
|
|
|
|
*
|
|
|
|
* @return A pair, of which the first element is an iterator that points
|
|
|
|
* to the possibly inserted pair, and the second is a bool that
|
|
|
|
* is true if the pair was actually inserted.
|
|
|
|
*
|
|
|
|
* This function attempts to build and insert a (key, value) %pair into
|
|
|
|
* the %map.
|
|
|
|
* A %map relies on unique keys and thus a %pair is only inserted if its
|
|
|
|
* first element (the key) is not already present in the %map.
|
|
|
|
*
|
|
|
|
* Insertion requires logarithmic time.
|
|
|
|
*/
|
|
|
|
template<typename... _Args>
|
|
|
|
std::pair<iterator, bool>
|
|
|
|
emplace(_Args&&... __args)
|
|
|
|
{ return _M_t._M_emplace_unique(std::forward<_Args>(__args)...); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Attempts to build and insert a std::pair into the %map.
|
|
|
|
*
|
|
|
|
* @param __pos An iterator that serves as a hint as to where the pair
|
|
|
|
* should be inserted.
|
|
|
|
* @param __args Arguments used to generate a new pair instance (see
|
|
|
|
* std::piecewise_contruct for passing arguments to each
|
|
|
|
* part of the pair constructor).
|
|
|
|
* @return An iterator that points to the element with key of the
|
|
|
|
* std::pair built from @a __args (may or may not be that
|
|
|
|
* std::pair).
|
|
|
|
*
|
|
|
|
* This function is not concerned about whether the insertion took place,
|
|
|
|
* and thus does not return a boolean like the single-argument emplace()
|
|
|
|
* does.
|
|
|
|
* Note that the first parameter is only a hint and can potentially
|
|
|
|
* improve the performance of the insertion process. A bad hint would
|
|
|
|
* cause no gains in efficiency.
|
|
|
|
*
|
|
|
|
* See
|
|
|
|
* http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
|
|
|
|
* for more on @a hinting.
|
|
|
|
*
|
|
|
|
* Insertion requires logarithmic time (if the hint is not taken).
|
|
|
|
*/
|
|
|
|
template<typename... _Args>
|
|
|
|
iterator
|
|
|
|
emplace_hint(const_iterator __pos, _Args&&... __args)
|
|
|
|
{
|
|
|
|
return _M_t._M_emplace_hint_unique(__pos,
|
|
|
|
std::forward<_Args>(__args)...);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Attempts to insert a std::pair into the %map.
|
2006-02-22 01:57:24 +01:00
|
|
|
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Pair to be inserted (see std::make_pair for easy
|
|
|
|
* creation of pairs).
|
|
|
|
*
|
2006-02-22 01:57:24 +01:00
|
|
|
* @return A pair, of which the first element is an iterator that
|
|
|
|
* points to the possibly inserted pair, and the second is
|
|
|
|
* a bool that is true if the pair was actually inserted.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
|
|
|
* This function attempts to insert a (key, value) %pair into the %map.
|
|
|
|
* A %map relies on unique keys and thus a %pair is only inserted if its
|
|
|
|
* first element (the key) is not already present in the %map.
|
|
|
|
*
|
|
|
|
* Insertion requires logarithmic time.
|
|
|
|
*/
|
2007-04-03 10:50:09 +02:00
|
|
|
std::pair<iterator, bool>
|
2004-02-01 18:34:44 +01:00
|
|
|
insert(const value_type& __x)
|
2006-01-06 20:11:06 +01:00
|
|
|
{ return _M_t._M_insert_unique(__x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
PR libstdc++/44436 (partial)
2010-11-10 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44436 (partial)
PR libstdc++/46148
* include/bits/stl_tree.h (_Rb_tree<>::_M_insert_, _M_insert_lower,
_M_insert_equal_lower, _M_insert_unique, _M_insert_equal,
_M_insert_unique_, _M_insert_equal_): Templatize in C++0x mode,
use _GLIBCXX_FORWARD throughout.
* include/bits/stl_map.h (map<>::insert(_Pair&&),
insert(const_iterator, _Pair&&), operator[](key_type&&): Add.
* include/bits/stl_set.h (set<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/bits/stl_multimap.h (multimap<>::insert(_Pair&&),
insert(const_iterator, _Pair&&)): Likewise.
* include/bits/stl_multiset.h (multiset<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/debug/set.h: Adjust.
* include/debug/multiset.h: Likewise.
* include/debug/map.h: Likewise.
* include/debug/multimap.h: Likewise.
* include/profile/set.h: Likewise.
* include/profile/multiset.h: Likewise.
* include/profile/map.h: Likewise.
* include/profile/multimap.h: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/1.cc: New.
* testsuite/23_containers/multimap/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/5.cc: Likewise.
* testsuite/23_containers/map/element_access/2.cc: Likewise.
* testsuite/23_containers/map/element_access/46148.cc: Likewise.
* include/bits/hashtable.h: Trivial naming changes.
From-SVN: r166551
2010-11-10 20:08:49 +01:00
|
|
|
template<typename _Pair, typename = typename
|
2012-07-13 10:59:58 +02:00
|
|
|
std::enable_if<std::is_constructible<value_type,
|
|
|
|
_Pair&&>::value>::type>
|
PR libstdc++/44436 (partial)
2010-11-10 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44436 (partial)
PR libstdc++/46148
* include/bits/stl_tree.h (_Rb_tree<>::_M_insert_, _M_insert_lower,
_M_insert_equal_lower, _M_insert_unique, _M_insert_equal,
_M_insert_unique_, _M_insert_equal_): Templatize in C++0x mode,
use _GLIBCXX_FORWARD throughout.
* include/bits/stl_map.h (map<>::insert(_Pair&&),
insert(const_iterator, _Pair&&), operator[](key_type&&): Add.
* include/bits/stl_set.h (set<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/bits/stl_multimap.h (multimap<>::insert(_Pair&&),
insert(const_iterator, _Pair&&)): Likewise.
* include/bits/stl_multiset.h (multiset<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/debug/set.h: Adjust.
* include/debug/multiset.h: Likewise.
* include/debug/map.h: Likewise.
* include/debug/multimap.h: Likewise.
* include/profile/set.h: Likewise.
* include/profile/multiset.h: Likewise.
* include/profile/map.h: Likewise.
* include/profile/multimap.h: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/1.cc: New.
* testsuite/23_containers/multimap/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/5.cc: Likewise.
* testsuite/23_containers/map/element_access/2.cc: Likewise.
* testsuite/23_containers/map/element_access/46148.cc: Likewise.
* include/bits/hashtable.h: Trivial naming changes.
From-SVN: r166551
2010-11-10 20:08:49 +01:00
|
|
|
std::pair<iterator, bool>
|
|
|
|
insert(_Pair&& __x)
|
|
|
|
{ return _M_t._M_insert_unique(std::forward<_Pair>(__x)); }
|
|
|
|
#endif
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
Implement WG21 N2672, Initializer List proposed wording
gcc/cp/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
Implement WG21 N2672, Initializer List proposed wording
* cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
(struct lang_type_class): Add has_list_ctor bitfield.
(TYPE_HAS_LIST_CTOR): New macro.
(BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
(CONSTRUCTOR_IS_DIRECT_INIT): New macro.
(LOOKUP_NO_NARROWING): New macro.
(LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
* parser.c (cp_parse_braced_list): Split out from...
(cp_parser_initializer_clause): ...here.
(cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
literal here.
(cp_lexer_next_token_is_not_keyword): New fn.
(cp_parser_parenthesized_expression_list): Handle { }.
(cp_parser_new_expression, cp_parser_new_initializer): Likewise.
(cp_parser_assignment_expression, cp_parser_condition): Likewise.
(cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
(cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
(cp_parser_initializer, cp_parser_functional_cast): Likewise.
(cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
(cp_parser_save_member_function_body): Likewise.
* call.c (conversion_kind): Add ck_list, ck_aggr.
(struct conversion): Add check_narrowing bitfield, conversion list.
(build_list_conv): New fn.
(build_aggr_conv): New fn.
(implicit_conversion): Call them.
(standard_conversion): Set check_narrowing if appropriate.
(add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
(build_user_type_conversion_1): When converting from an init list,
we allow additional conversions except when calling a copy ctor.
(convert_like_real): Calling an explicit ctor for an init list is
ill-formed. Handle ck_list and ck_addr. Check narrowing.
(build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
class doesn't have a list ctor, break the {} into a TREE_LIST.
(compare_ics): ck_list is better than other UDCs.
(set_up_extended_ref_temp): Split out from initialize_reference.
(is_std_init_list): New fn.
(is_list_ctor): New fn.
* decl.c (cxx_init_decl_processing): Create init_list_type_node.
(reshape_init_array_1): Pass it to build_constructor.
(reshape_init_class): Ditto.
(initialize_artificial_var): Pass the appropriate type.
(build_aggr_init_full_exprs): Split out from...
(check_initializer): ...here. Handle new semantics.
(build_init_list_var_init): New subroutine of check_initializer.
(grokdeclarator): Converting constructors can have more than one parm.
(grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
* init.c (expand_default_init): Only do digest_init for aggregates.
* rtti.c (tinfo_base_init): Pass init_list_type_node to
build_constructor_from_list.
(generic_initializer, ptr_initializer): Ditto.
(ptm_initializer, class_initializer): Ditto.
(get_pseudo_ti_init): Ditto.
* error.c (dump_type): Handle init_list_type_node.
(maybe_warn_cpp0x): New fn.
(maybe_varn_variadic_templates): Call it.
* cvt.c (ocp_convert): Handle conversion from { }.
* tree.c (build_array_of_n_type): New fn.
* typeck2.c (store_init_value): Use init_list_type_node.
(digest_init): Likewise.
(check_narrowing): New fn.
* semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
of vector of constructor elts. Handle non-aggregate types. Make
constant literals static.
* pt.c: (tsubst_copy_and_build): Adjust.
(unify): Handle { }.
* name-lookup.c (arg_assoc_type): Handle init_list_type_node.
gcc/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
* tree.c (ctor_to_list): New fn.
* tree.h: Declare it.
(CONSTRUCTOR_ELT): New macro.
(CONSTRUCTOR_NELTS): New macro.
libstdc++-v3/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
* libsupc++/initializer_list: New file.
* include/bits/stl_map.h (insert(initializer_list)): New method.
From-SVN: r137361
2008-07-02 17:38:50 +02:00
|
|
|
/**
|
|
|
|
* @brief Attempts to insert a list of std::pairs into the %map.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __list A std::initializer_list<value_type> of pairs to be
|
|
|
|
* inserted.
|
Implement WG21 N2672, Initializer List proposed wording
gcc/cp/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
Implement WG21 N2672, Initializer List proposed wording
* cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
(struct lang_type_class): Add has_list_ctor bitfield.
(TYPE_HAS_LIST_CTOR): New macro.
(BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
(CONSTRUCTOR_IS_DIRECT_INIT): New macro.
(LOOKUP_NO_NARROWING): New macro.
(LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
* parser.c (cp_parse_braced_list): Split out from...
(cp_parser_initializer_clause): ...here.
(cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
literal here.
(cp_lexer_next_token_is_not_keyword): New fn.
(cp_parser_parenthesized_expression_list): Handle { }.
(cp_parser_new_expression, cp_parser_new_initializer): Likewise.
(cp_parser_assignment_expression, cp_parser_condition): Likewise.
(cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
(cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
(cp_parser_initializer, cp_parser_functional_cast): Likewise.
(cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
(cp_parser_save_member_function_body): Likewise.
* call.c (conversion_kind): Add ck_list, ck_aggr.
(struct conversion): Add check_narrowing bitfield, conversion list.
(build_list_conv): New fn.
(build_aggr_conv): New fn.
(implicit_conversion): Call them.
(standard_conversion): Set check_narrowing if appropriate.
(add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
(build_user_type_conversion_1): When converting from an init list,
we allow additional conversions except when calling a copy ctor.
(convert_like_real): Calling an explicit ctor for an init list is
ill-formed. Handle ck_list and ck_addr. Check narrowing.
(build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
class doesn't have a list ctor, break the {} into a TREE_LIST.
(compare_ics): ck_list is better than other UDCs.
(set_up_extended_ref_temp): Split out from initialize_reference.
(is_std_init_list): New fn.
(is_list_ctor): New fn.
* decl.c (cxx_init_decl_processing): Create init_list_type_node.
(reshape_init_array_1): Pass it to build_constructor.
(reshape_init_class): Ditto.
(initialize_artificial_var): Pass the appropriate type.
(build_aggr_init_full_exprs): Split out from...
(check_initializer): ...here. Handle new semantics.
(build_init_list_var_init): New subroutine of check_initializer.
(grokdeclarator): Converting constructors can have more than one parm.
(grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
* init.c (expand_default_init): Only do digest_init for aggregates.
* rtti.c (tinfo_base_init): Pass init_list_type_node to
build_constructor_from_list.
(generic_initializer, ptr_initializer): Ditto.
(ptm_initializer, class_initializer): Ditto.
(get_pseudo_ti_init): Ditto.
* error.c (dump_type): Handle init_list_type_node.
(maybe_warn_cpp0x): New fn.
(maybe_varn_variadic_templates): Call it.
* cvt.c (ocp_convert): Handle conversion from { }.
* tree.c (build_array_of_n_type): New fn.
* typeck2.c (store_init_value): Use init_list_type_node.
(digest_init): Likewise.
(check_narrowing): New fn.
* semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
of vector of constructor elts. Handle non-aggregate types. Make
constant literals static.
* pt.c: (tsubst_copy_and_build): Adjust.
(unify): Handle { }.
* name-lookup.c (arg_assoc_type): Handle init_list_type_node.
gcc/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
* tree.c (ctor_to_list): New fn.
* tree.h: Declare it.
(CONSTRUCTOR_ELT): New macro.
(CONSTRUCTOR_NELTS): New macro.
libstdc++-v3/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
* libsupc++/initializer_list: New file.
* include/bits/stl_map.h (insert(initializer_list)): New method.
From-SVN: r137361
2008-07-02 17:38:50 +02:00
|
|
|
*
|
|
|
|
* Complexity similar to that of the range constructor.
|
|
|
|
*/
|
|
|
|
void
|
2008-07-03 06:32:25 +02:00
|
|
|
insert(std::initializer_list<value_type> __list)
|
2010-11-08 17:07:32 +01:00
|
|
|
{ insert(__list.begin(), __list.end()); }
|
2008-07-03 06:32:25 +02:00
|
|
|
#endif
|
Implement WG21 N2672, Initializer List proposed wording
gcc/cp/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
Implement WG21 N2672, Initializer List proposed wording
* cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
(struct lang_type_class): Add has_list_ctor bitfield.
(TYPE_HAS_LIST_CTOR): New macro.
(BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
(CONSTRUCTOR_IS_DIRECT_INIT): New macro.
(LOOKUP_NO_NARROWING): New macro.
(LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
* parser.c (cp_parse_braced_list): Split out from...
(cp_parser_initializer_clause): ...here.
(cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
literal here.
(cp_lexer_next_token_is_not_keyword): New fn.
(cp_parser_parenthesized_expression_list): Handle { }.
(cp_parser_new_expression, cp_parser_new_initializer): Likewise.
(cp_parser_assignment_expression, cp_parser_condition): Likewise.
(cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
(cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
(cp_parser_initializer, cp_parser_functional_cast): Likewise.
(cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
(cp_parser_save_member_function_body): Likewise.
* call.c (conversion_kind): Add ck_list, ck_aggr.
(struct conversion): Add check_narrowing bitfield, conversion list.
(build_list_conv): New fn.
(build_aggr_conv): New fn.
(implicit_conversion): Call them.
(standard_conversion): Set check_narrowing if appropriate.
(add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
(build_user_type_conversion_1): When converting from an init list,
we allow additional conversions except when calling a copy ctor.
(convert_like_real): Calling an explicit ctor for an init list is
ill-formed. Handle ck_list and ck_addr. Check narrowing.
(build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
class doesn't have a list ctor, break the {} into a TREE_LIST.
(compare_ics): ck_list is better than other UDCs.
(set_up_extended_ref_temp): Split out from initialize_reference.
(is_std_init_list): New fn.
(is_list_ctor): New fn.
* decl.c (cxx_init_decl_processing): Create init_list_type_node.
(reshape_init_array_1): Pass it to build_constructor.
(reshape_init_class): Ditto.
(initialize_artificial_var): Pass the appropriate type.
(build_aggr_init_full_exprs): Split out from...
(check_initializer): ...here. Handle new semantics.
(build_init_list_var_init): New subroutine of check_initializer.
(grokdeclarator): Converting constructors can have more than one parm.
(grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
* init.c (expand_default_init): Only do digest_init for aggregates.
* rtti.c (tinfo_base_init): Pass init_list_type_node to
build_constructor_from_list.
(generic_initializer, ptr_initializer): Ditto.
(ptm_initializer, class_initializer): Ditto.
(get_pseudo_ti_init): Ditto.
* error.c (dump_type): Handle init_list_type_node.
(maybe_warn_cpp0x): New fn.
(maybe_varn_variadic_templates): Call it.
* cvt.c (ocp_convert): Handle conversion from { }.
* tree.c (build_array_of_n_type): New fn.
* typeck2.c (store_init_value): Use init_list_type_node.
(digest_init): Likewise.
(check_narrowing): New fn.
* semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
of vector of constructor elts. Handle non-aggregate types. Make
constant literals static.
* pt.c: (tsubst_copy_and_build): Adjust.
(unify): Handle { }.
* name-lookup.c (arg_assoc_type): Handle init_list_type_node.
gcc/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
* tree.c (ctor_to_list): New fn.
* tree.h: Declare it.
(CONSTRUCTOR_ELT): New macro.
(CONSTRUCTOR_NELTS): New macro.
libstdc++-v3/ChangeLog:
2008-07-02 Jason Merrill <jason@redhat.com>
* libsupc++/initializer_list: New file.
* include/bits/stl_map.h (insert(initializer_list)): New method.
From-SVN: r137361
2008-07-02 17:38:50 +02:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Attempts to insert a std::pair into the %map.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __position An iterator that serves as a hint as to where the
|
2004-02-01 18:34:44 +01:00
|
|
|
* pair should be inserted.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Pair to be inserted (see std::make_pair for easy creation
|
|
|
|
* of pairs).
|
|
|
|
* @return An iterator that points to the element with key of
|
|
|
|
* @a __x (may or may not be the %pair passed in).
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
2006-02-22 01:57:24 +01:00
|
|
|
|
|
|
|
* This function is not concerned about whether the insertion
|
|
|
|
* took place, and thus does not return a boolean like the
|
|
|
|
* single-argument insert() does. Note that the first
|
|
|
|
* parameter is only a hint and can potentially improve the
|
|
|
|
* performance of the insertion process. A bad hint would
|
|
|
|
* cause no gains in efficiency.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
2006-02-22 01:57:24 +01:00
|
|
|
* See
|
2008-12-02 05:55:54 +01:00
|
|
|
* http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
|
2010-02-04 19:20:34 +01:00
|
|
|
* for more on @a hinting.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
|
|
|
* Insertion requires logarithmic time (if the hint is not taken).
|
|
|
|
*/
|
|
|
|
iterator
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2010-11-08 17:07:32 +01:00
|
|
|
insert(const_iterator __position, const value_type& __x)
|
|
|
|
#else
|
2007-04-03 10:50:09 +02:00
|
|
|
insert(iterator __position, const value_type& __x)
|
2010-11-08 17:07:32 +01:00
|
|
|
#endif
|
2007-04-03 10:50:09 +02:00
|
|
|
{ return _M_t._M_insert_unique_(__position, __x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
PR libstdc++/44436 (partial)
2010-11-10 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44436 (partial)
PR libstdc++/46148
* include/bits/stl_tree.h (_Rb_tree<>::_M_insert_, _M_insert_lower,
_M_insert_equal_lower, _M_insert_unique, _M_insert_equal,
_M_insert_unique_, _M_insert_equal_): Templatize in C++0x mode,
use _GLIBCXX_FORWARD throughout.
* include/bits/stl_map.h (map<>::insert(_Pair&&),
insert(const_iterator, _Pair&&), operator[](key_type&&): Add.
* include/bits/stl_set.h (set<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/bits/stl_multimap.h (multimap<>::insert(_Pair&&),
insert(const_iterator, _Pair&&)): Likewise.
* include/bits/stl_multiset.h (multiset<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/debug/set.h: Adjust.
* include/debug/multiset.h: Likewise.
* include/debug/map.h: Likewise.
* include/debug/multimap.h: Likewise.
* include/profile/set.h: Likewise.
* include/profile/multiset.h: Likewise.
* include/profile/map.h: Likewise.
* include/profile/multimap.h: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/1.cc: New.
* testsuite/23_containers/multimap/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/5.cc: Likewise.
* testsuite/23_containers/map/element_access/2.cc: Likewise.
* testsuite/23_containers/map/element_access/46148.cc: Likewise.
* include/bits/hashtable.h: Trivial naming changes.
From-SVN: r166551
2010-11-10 20:08:49 +01:00
|
|
|
template<typename _Pair, typename = typename
|
2012-07-13 10:59:58 +02:00
|
|
|
std::enable_if<std::is_constructible<value_type,
|
|
|
|
_Pair&&>::value>::type>
|
PR libstdc++/44436 (partial)
2010-11-10 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44436 (partial)
PR libstdc++/46148
* include/bits/stl_tree.h (_Rb_tree<>::_M_insert_, _M_insert_lower,
_M_insert_equal_lower, _M_insert_unique, _M_insert_equal,
_M_insert_unique_, _M_insert_equal_): Templatize in C++0x mode,
use _GLIBCXX_FORWARD throughout.
* include/bits/stl_map.h (map<>::insert(_Pair&&),
insert(const_iterator, _Pair&&), operator[](key_type&&): Add.
* include/bits/stl_set.h (set<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/bits/stl_multimap.h (multimap<>::insert(_Pair&&),
insert(const_iterator, _Pair&&)): Likewise.
* include/bits/stl_multiset.h (multiset<>::insert(value_type&&),
insert(const_iterator, value_type&&)): Likewise.
* include/debug/set.h: Adjust.
* include/debug/multiset.h: Likewise.
* include/debug/map.h: Likewise.
* include/debug/multimap.h: Likewise.
* include/profile/set.h: Likewise.
* include/profile/multiset.h: Likewise.
* include/profile/map.h: Likewise.
* include/profile/multimap.h: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/1.cc: New.
* testsuite/23_containers/multimap/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/set/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/2.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/3.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/4.cc: Likewise.
* testsuite/23_containers/map/modifiers/insert/5.cc: Likewise.
* testsuite/23_containers/map/element_access/2.cc: Likewise.
* testsuite/23_containers/map/element_access/46148.cc: Likewise.
* include/bits/hashtable.h: Trivial naming changes.
From-SVN: r166551
2010-11-10 20:08:49 +01:00
|
|
|
iterator
|
|
|
|
insert(const_iterator __position, _Pair&& __x)
|
|
|
|
{ return _M_t._M_insert_unique_(__position,
|
|
|
|
std::forward<_Pair>(__x)); }
|
|
|
|
#endif
|
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
2008-01-31 19:44:55 +01:00
|
|
|
* @brief Template function that attempts to insert a range of elements.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __first Iterator pointing to the start of the range to be
|
|
|
|
* inserted.
|
|
|
|
* @param __last Iterator pointing to the end of the range.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
|
|
|
* Complexity similar to that of the range constructor.
|
|
|
|
*/
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _InputIterator>
|
2004-02-01 18:34:44 +01:00
|
|
|
void
|
|
|
|
insert(_InputIterator __first, _InputIterator __last)
|
2006-01-06 20:11:06 +01:00
|
|
|
{ _M_t._M_insert_unique(__first, __last); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2009-08-14 19:54:44 +02:00
|
|
|
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
|
|
|
// DR 130. Associative erase should return an iterator.
|
|
|
|
/**
|
|
|
|
* @brief Erases an element from a %map.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __position An iterator pointing to the element to be erased.
|
2009-08-14 19:54:44 +02:00
|
|
|
* @return An iterator pointing to the element immediately following
|
|
|
|
* @a position prior to the element being erased. If no such
|
|
|
|
* element exists, end() is returned.
|
|
|
|
*
|
|
|
|
* This function erases an element, pointed to by the given
|
|
|
|
* iterator, from a %map. Note that this function only erases
|
|
|
|
* the element, and that if the element is itself a pointer,
|
|
|
|
* the pointed-to memory is not touched in any way. Managing
|
|
|
|
* the pointer is the user's responsibility.
|
|
|
|
*/
|
|
|
|
iterator
|
2010-11-08 17:07:32 +01:00
|
|
|
erase(const_iterator __position)
|
2009-08-14 19:54:44 +02:00
|
|
|
{ return _M_t.erase(__position); }
|
2011-11-16 00:28:49 +01:00
|
|
|
|
|
|
|
// LWG 2059.
|
|
|
|
iterator
|
|
|
|
erase(iterator __position)
|
|
|
|
{ return _M_t.erase(__position); }
|
2009-08-14 19:54:44 +02:00
|
|
|
#else
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Erases an element from a %map.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __position An iterator pointing to the element to be erased.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
2006-02-22 01:57:24 +01:00
|
|
|
* This function erases an element, pointed to by the given
|
|
|
|
* iterator, from a %map. Note that this function only erases
|
|
|
|
* the element, and that if the element is itself a pointer,
|
|
|
|
* the pointed-to memory is not touched in any way. Managing
|
2008-01-31 19:44:55 +01:00
|
|
|
* the pointer is the user's responsibility.
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
void
|
2004-02-01 18:34:44 +01:00
|
|
|
erase(iterator __position)
|
|
|
|
{ _M_t.erase(__position); }
|
2009-08-14 19:54:44 +02:00
|
|
|
#endif
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Erases elements according to the provided key.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Key of element to be erased.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return The number of elements erased.
|
|
|
|
*
|
|
|
|
* This function erases all the elements located by the given key from
|
|
|
|
* a %map.
|
|
|
|
* Note that this function only erases the element, and that if
|
|
|
|
* the element is itself a pointer, the pointed-to memory is not touched
|
2008-01-31 19:44:55 +01:00
|
|
|
* in any way. Managing the pointer is the user's responsibility.
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
|
|
|
size_type
|
|
|
|
erase(const key_type& __x)
|
|
|
|
{ return _M_t.erase(__x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2009-08-14 19:54:44 +02:00
|
|
|
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
|
|
|
// DR 130. Associative erase should return an iterator.
|
|
|
|
/**
|
|
|
|
* @brief Erases a [first,last) range of elements from a %map.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __first Iterator pointing to the start of the range to be
|
|
|
|
* erased.
|
|
|
|
* @param __last Iterator pointing to the end of the range to
|
|
|
|
* be erased.
|
|
|
|
* @return The iterator @a __last.
|
2009-08-14 19:54:44 +02:00
|
|
|
*
|
|
|
|
* This function erases a sequence of elements from a %map.
|
|
|
|
* Note that this function only erases the element, and that if
|
|
|
|
* the element is itself a pointer, the pointed-to memory is not touched
|
|
|
|
* in any way. Managing the pointer is the user's responsibility.
|
|
|
|
*/
|
|
|
|
iterator
|
2010-11-08 17:07:32 +01:00
|
|
|
erase(const_iterator __first, const_iterator __last)
|
2009-08-14 19:54:44 +02:00
|
|
|
{ return _M_t.erase(__first, __last); }
|
|
|
|
#else
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
2011-08-07 09:27:06 +02:00
|
|
|
* @brief Erases a [__first,__last) range of elements from a %map.
|
|
|
|
* @param __first Iterator pointing to the start of the range to be
|
|
|
|
* erased.
|
|
|
|
* @param __last Iterator pointing to the end of the range to
|
|
|
|
* be erased.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
|
|
|
* This function erases a sequence of elements from a %map.
|
|
|
|
* Note that this function only erases the element, and that if
|
|
|
|
* the element is itself a pointer, the pointed-to memory is not touched
|
2008-01-31 19:44:55 +01:00
|
|
|
* in any way. Managing the pointer is the user's responsibility.
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
erase(iterator __first, iterator __last)
|
|
|
|
{ _M_t.erase(__first, __last); }
|
2009-08-14 19:54:44 +02:00
|
|
|
#endif
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Swaps data with another %map.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x A %map of the same element and allocator types.
|
2004-02-01 18:34:44 +01:00
|
|
|
*
|
2006-02-22 01:57:24 +01:00
|
|
|
* This exchanges the elements between two maps in constant
|
|
|
|
* time. (It is only swapping a pointer, an integer, and an
|
|
|
|
* instance of the @c Compare type (which itself is often
|
|
|
|
* stateless and empty), so it should be quite fast.) Note
|
|
|
|
* that the global std::swap() function is specialized such
|
|
|
|
* that std::swap(m1,m2) will feed to this function.
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
swap(map& __x)
|
|
|
|
{ _M_t.swap(__x._M_t); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
2006-02-22 01:57:24 +01:00
|
|
|
* Erases all elements in a %map. Note that this function only
|
|
|
|
* erases the elements, and that if the elements themselves are
|
|
|
|
* pointers, the pointed-to memory is not touched in any way.
|
2008-01-31 19:44:55 +01:00
|
|
|
* Managing the pointer is the user's responsibility.
|
2004-02-01 18:34:44 +01:00
|
|
|
*/
|
|
|
|
void
|
2011-05-26 17:35:02 +02:00
|
|
|
clear() _GLIBCXX_NOEXCEPT
|
2004-02-01 18:34:44 +01:00
|
|
|
{ _M_t.clear(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
// observers
|
|
|
|
/**
|
|
|
|
* Returns the key comparison object out of which the %map was
|
|
|
|
* constructed.
|
|
|
|
*/
|
|
|
|
key_compare
|
|
|
|
key_comp() const
|
|
|
|
{ return _M_t.key_comp(); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* Returns a value comparison object, built from the key comparison
|
|
|
|
* object out of which the %map was constructed.
|
|
|
|
*/
|
|
|
|
value_compare
|
|
|
|
value_comp() const
|
|
|
|
{ return value_compare(_M_t.key_comp()); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
// [23.3.1.3] map operations
|
|
|
|
/**
|
|
|
|
* @brief Tries to locate an element in a %map.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Key of (key, value) %pair to be located.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return Iterator pointing to sought-after element, or end() if not
|
|
|
|
* found.
|
|
|
|
*
|
|
|
|
* This function takes a key and tries to locate the element with which
|
|
|
|
* the key matches. If successful the function returns an iterator
|
|
|
|
* pointing to the sought after %pair. If unsuccessful it returns the
|
|
|
|
* past-the-end ( @c end() ) iterator.
|
|
|
|
*/
|
|
|
|
iterator
|
|
|
|
find(const key_type& __x)
|
|
|
|
{ return _M_t.find(__x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Tries to locate an element in a %map.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Key of (key, value) %pair to be located.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return Read-only (constant) iterator pointing to sought-after
|
|
|
|
* element, or end() if not found.
|
|
|
|
*
|
|
|
|
* This function takes a key and tries to locate the element with which
|
|
|
|
* the key matches. If successful the function returns a constant
|
|
|
|
* iterator pointing to the sought after %pair. If unsuccessful it
|
|
|
|
* returns the past-the-end ( @c end() ) iterator.
|
|
|
|
*/
|
|
|
|
const_iterator
|
|
|
|
find(const key_type& __x) const
|
|
|
|
{ return _M_t.find(__x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Finds the number of elements with given key.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Key of (key, value) pairs to be located.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return Number of elements with specified key.
|
|
|
|
*
|
|
|
|
* This function only makes sense for multimaps; for map the result will
|
|
|
|
* either be 0 (not present) or 1 (present).
|
|
|
|
*/
|
|
|
|
size_type
|
|
|
|
count(const key_type& __x) const
|
|
|
|
{ return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Finds the beginning of a subsequence matching given key.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Key of (key, value) pair to be located.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return Iterator pointing to first element equal to or greater
|
|
|
|
* than key, or end().
|
|
|
|
*
|
|
|
|
* This function returns the first element of a subsequence of elements
|
|
|
|
* that matches the given key. If unsuccessful it returns an iterator
|
|
|
|
* pointing to the first element that has a greater value than given key
|
|
|
|
* or end() if no such element exists.
|
|
|
|
*/
|
|
|
|
iterator
|
|
|
|
lower_bound(const key_type& __x)
|
|
|
|
{ return _M_t.lower_bound(__x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Finds the beginning of a subsequence matching given key.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Key of (key, value) pair to be located.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return Read-only (constant) iterator pointing to first element
|
|
|
|
* equal to or greater than key, or end().
|
|
|
|
*
|
|
|
|
* This function returns the first element of a subsequence of elements
|
|
|
|
* that matches the given key. If unsuccessful it returns an iterator
|
|
|
|
* pointing to the first element that has a greater value than given key
|
|
|
|
* or end() if no such element exists.
|
|
|
|
*/
|
|
|
|
const_iterator
|
|
|
|
lower_bound(const key_type& __x) const
|
|
|
|
{ return _M_t.lower_bound(__x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Finds the end of a subsequence matching given key.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Key of (key, value) pair to be located.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return Iterator pointing to the first element
|
|
|
|
* greater than key, or end().
|
|
|
|
*/
|
|
|
|
iterator
|
|
|
|
upper_bound(const key_type& __x)
|
|
|
|
{ return _M_t.upper_bound(__x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Finds the end of a subsequence matching given key.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Key of (key, value) pair to be located.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return Read-only (constant) iterator pointing to first iterator
|
|
|
|
* greater than key, or end().
|
|
|
|
*/
|
|
|
|
const_iterator
|
|
|
|
upper_bound(const key_type& __x) const
|
|
|
|
{ return _M_t.upper_bound(__x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Finds a subsequence matching given key.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Key of (key, value) pairs to be located.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return Pair of iterators that possibly points to the subsequence
|
|
|
|
* matching given key.
|
|
|
|
*
|
|
|
|
* This function is equivalent to
|
|
|
|
* @code
|
|
|
|
* std::make_pair(c.lower_bound(val),
|
|
|
|
* c.upper_bound(val))
|
|
|
|
* @endcode
|
|
|
|
* (but is faster than making the calls separately).
|
|
|
|
*
|
|
|
|
* This function probably only makes sense for multimaps.
|
|
|
|
*/
|
2005-06-03 19:07:48 +02:00
|
|
|
std::pair<iterator, iterator>
|
2004-02-01 18:34:44 +01:00
|
|
|
equal_range(const key_type& __x)
|
|
|
|
{ return _M_t.equal_range(__x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
2004-02-01 18:34:44 +01:00
|
|
|
/**
|
|
|
|
* @brief Finds a subsequence matching given key.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x Key of (key, value) pairs to be located.
|
2004-02-01 18:34:44 +01:00
|
|
|
* @return Pair of read-only (constant) iterators that possibly points
|
|
|
|
* to the subsequence matching given key.
|
|
|
|
*
|
|
|
|
* This function is equivalent to
|
|
|
|
* @code
|
|
|
|
* std::make_pair(c.lower_bound(val),
|
|
|
|
* c.upper_bound(val))
|
|
|
|
* @endcode
|
|
|
|
* (but is faster than making the calls separately).
|
|
|
|
*
|
|
|
|
* This function probably only makes sense for multimaps.
|
|
|
|
*/
|
2005-06-03 19:07:48 +02:00
|
|
|
std::pair<const_iterator, const_iterator>
|
2004-02-01 18:34:44 +01:00
|
|
|
equal_range(const key_type& __x) const
|
|
|
|
{ return _M_t.equal_range(__x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _K1, typename _T1, typename _C1, typename _A1>
|
2004-02-02 00:19:55 +01:00
|
|
|
friend bool
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
operator==(const map<_K1, _T1, _C1, _A1>&,
|
|
|
|
const map<_K1, _T1, _C1, _A1>&);
|
2004-02-02 00:19:55 +01:00
|
|
|
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _K1, typename _T1, typename _C1, typename _A1>
|
2004-02-02 00:19:55 +01:00
|
|
|
friend bool
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
operator<(const map<_K1, _T1, _C1, _A1>&,
|
|
|
|
const map<_K1, _T1, _C1, _A1>&);
|
2004-02-01 18:34:44 +01:00
|
|
|
};
|
2004-02-08 05:46:42 +01:00
|
|
|
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
/**
|
|
|
|
* @brief Map equality comparison.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x A %map.
|
|
|
|
* @param __y A %map of the same type as @a x.
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
* @return True iff the size and elements of the maps are equal.
|
2002-02-05 01:14:37 +01:00
|
|
|
*
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
* This is an equivalence relation. It is linear in the size of the
|
|
|
|
* maps. Maps are considered equivalent if their sizes are equal,
|
|
|
|
* and if corresponding elements compare equal.
|
|
|
|
*/
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
inline bool
|
2005-06-03 19:07:48 +02:00
|
|
|
operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
|
|
|
|
const map<_Key, _Tp, _Compare, _Alloc>& __y)
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
{ return __x._M_t == __y._M_t; }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
/**
|
|
|
|
* @brief Map ordering relation.
|
2011-08-07 09:27:06 +02:00
|
|
|
* @param __x A %map.
|
|
|
|
* @param __y A %map of the same type as @a x.
|
2002-12-23 18:36:24 +01:00
|
|
|
* @return True iff @a x is lexicographically less than @a y.
|
2002-02-05 01:14:37 +01:00
|
|
|
*
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
* This is a total ordering relation. It is linear in the size of the
|
|
|
|
* maps. The elements must be comparable with @c <.
|
2002-02-05 01:14:37 +01:00
|
|
|
*
|
2002-12-23 18:36:24 +01:00
|
|
|
* See std::lexicographical_compare() for how the determination is made.
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
*/
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
inline bool
|
2005-06-03 19:07:48 +02:00
|
|
|
operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
|
|
|
|
const map<_Key, _Tp, _Compare, _Alloc>& __y)
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
{ return __x._M_t < __y._M_t; }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
/// Based on operator==
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
inline bool
|
2005-06-03 19:07:48 +02:00
|
|
|
operator!=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
|
|
|
|
const map<_Key, _Tp, _Compare, _Alloc>& __y)
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
{ return !(__x == __y); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
/// Based on operator<
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
inline bool
|
2005-06-03 19:07:48 +02:00
|
|
|
operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x,
|
|
|
|
const map<_Key, _Tp, _Compare, _Alloc>& __y)
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
{ return __y < __x; }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
/// Based on operator<
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
inline bool
|
2005-06-03 19:07:48 +02:00
|
|
|
operator<=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
|
|
|
|
const map<_Key, _Tp, _Compare, _Alloc>& __y)
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
{ return !(__y < __x); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
/// Based on operator<
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
inline bool
|
2005-06-03 19:07:48 +02:00
|
|
|
operator>=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
|
|
|
|
const map<_Key, _Tp, _Compare, _Alloc>& __y)
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
{ return !(__x < __y); }
|
2004-02-08 05:46:42 +01:00
|
|
|
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
/// See std::map::swap().
|
[multiple changes]
2007-10-04 Paolo Carlini <pcarlini@suse.de>
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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:
Adjust dg-error line number.
* 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.
2007-10-04 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/bits/stl_vector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/bits/stl_bvector.h (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
* include/bits/stl_deque.h (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/bits/stl_set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/bits/stl_map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
2007-10-04 Paolo Carlini <pcarlini@suse.de>
Avoid copying some allocator objects.
* include/bits/stl_list.h (_List_impl::_List_impl(),
_List_base::_List_base(), list<>::list()): Add.
* include/bits/stl_vector.h (_Vector_impl::_Vector_impl(),
_Vector_base::_Vector_base(), vector<>::vector()): Add.
* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl(),
_Bvector_base::_Bvector_base(), vector<>::vector()): Add.
* include/bits/stl_deque.h (_Deque_impl::_Deque_impl(),
_Deque_base::_Deque_base(), deque<>::deque()): Add.
* include/bits/stl_tree.h (_Rb_tree_impl<>::_Rb_tree_impl(),
_Rb_tree_impl<>::_M_initialize): Add.
(_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&),
_Rb_tree(const _Rb_tree&)): Adjust.
* include/bits/stl_set.h (set<>::set(),
set(_InputIterator, _InputIterator)): Use _M_t default constructor.
* include/bits/stl_map.h (map<>::map(), set(_InputIterator,
_InputIterator)): Use _M_t default constructor.
* include/bits/stl_multiset.h (multiset<>::multiset(),
multiset(_InputIterator, _InputIterator)): Use _M_t default
constructor.
* include/bits/stl_multimap.h (multimap<>::multimap(),
multimap(_InputIterator, _InputIterator)): Use _M_t default
constructor.
From-SVN: r129013
2007-10-04 17:12:34 +02:00
|
|
|
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
inline void
|
2005-06-03 19:07:48 +02:00
|
|
|
swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
|
|
|
|
map<_Key, _Tp, _Compare, _Alloc>& __y)
|
deque.tcc, [...]: Re-indent contents of namespace std, re-wrap comment lines as necessary.
2002-08-09 Phil Edwards <pme@gcc.gnu.org>
* include/bits/deque.tcc, include/bits/list.tcc,
include/bits/stl_deque.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_queue.h,
include/bits/stl_stack.h, include/bits/stl_vector.h,
include/bits/vector.tcc: Re-indent contents of namespace std,
re-wrap comment lines as necessary.
From-SVN: r56165
2002-08-09 18:51:15 +02:00
|
|
|
{ __x.swap(__y); }
|
2005-12-19 01:56:05 +01: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
|
|
|
_GLIBCXX_END_NAMESPACE_CONTAINER
|
|
|
|
} // namespace std
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2007-06-18 19:22:53 +02:00
|
|
|
#endif /* _STL_MAP_H */
|