gcc/libstdc++-v3/include/bits/deque.tcc

1074 lines
32 KiB
Plaintext
Raw Normal View History

// Deque implementation (out of line) -*- C++ -*-
// Copyright (C) 2001-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/*
*
* 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) 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.
*/
/** @file bits/deque.tcc
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{deque}
*/
#ifndef _DEQUE_TCC
#define _DEQUE_TCC 1
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
c++config: Add in revised namespace associations. 2005-12-18 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Add in revised namespace associations. _GLIBCXX_BEGIN_NAMESPACE: New macro. _GLIBCXX_END_NAMESPACE: Same. _GLIBCXX_BEGIN_NESTED_NAMESPACE: Same. _GLIBCXX_END_NESTED_NAMESPACE: Same. * acinclude.m4 (GLIBCXX_ENABLE_SYMVERS]): Add gnu-versioned-namespace. * configure: Regenerated. * config.h.in: Same. * config/abi/pre/gnu-versioned-namespace.ver: New. * config/abi/pre/gnu.ver (GLIBCXX_3.4.7): Add exports for nested debug mode items. * include/Makefile.am (${host_builddir}/c++config.h): Fill in values for __GLIBCXX__ and _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION. * include/Makefile.in: Regnerate. * src/compatibility.cc: Alias new, nested definitions to exported symbols from non-nested __gnu_debug. * src/Makefile.am: Add in ENABLE_SYMVERS_GNU_NAMESPACE. * src/Makefile.in: Regenerate. * docs/html/debug_mode.html: Revise for nested design. * docs/html/debug.html: Use debug qualifications instead of __gnu_debug. * docs/html/configopts.html: Revise documentation for --enable-symvers. * include/debug/formatter: Simplify namespace qualifications for current, nested-only reality. Add top-level namespace alias, namespace debug, for debug-mode containers. * include/debug/safe_iterator.h: Same. * include/debug/set.h: Same. * include/debug/hash_multimap.h: Same. * include/debug/hash_set.h: Same. * include/debug/bitset * include/debug/safe_sequence.h: Same. * include/debug/multiset.h: Same. * include/debug/safe_base.h: Same. * include/debug/functions.h: Same. * include/debug/safe_iterator.tcc * include/debug/hash_multiset.h: Same. * include/debug/vector * include/debug/map.h: Same. * include/debug/deque * include/debug/hash_map.h: Same. * include/debug/string * include/debug/macros.h: Same. * include/debug/list * include/debug/debug.h: Same. * include/debug/multimap.h: Same. * src/debug.cc: Same. * testsuite/23_containers/vector/invalidation/1.cc: Cleanups. * testsuite/23_containers/vector/invalidation/2.cc: Same. * testsuite/23_containers/vector/invalidation/3.cc: Same. * testsuite/23_containers/vector/invalidation/4.cc: Same. * testsuite/23_containers/deque/invalidation/1.cc: Same. * testsuite/23_containers/deque/invalidation/2.cc: Same. * testsuite/23_containers/deque/invalidation/3.cc: Same. * testsuite/23_containers/deque/invalidation/4.cc: Same. * testsuite/23_containers/multiset/invalidation/1.cc: Same. * testsuite/23_containers/multiset/invalidation/2.cc: Same. * testsuite/23_containers/multimap/invalidation/1.cc: Same. * testsuite/23_containers/multimap/invalidation/2.cc: Same. * testsuite/23_containers/bitset/invalidation/1.cc: Same. * testsuite/23_containers/bitset/cons/16020.cc: Same. * testsuite/23_containers/bitset/operations/13838.cc: Same. * testsuite/23_containers/list/invalidation/1.cc: Same. * testsuite/23_containers/list/invalidation/2.cc: Same. * testsuite/23_containers/list/invalidation/3.cc: Same. * testsuite/23_containers/list/invalidation/4.cc: Same. * testsuite/23_containers/set/invalidation/1.cc: Same. * testsuite/23_containers/set/invalidation/2.cc: Same. * testsuite/23_containers/map/invalidation/1.cc: Same. * testsuite/23_containers/map/invalidation/2.cc: Same. * testsuite/23_containers/map/insert/16813.cc: Same. * include/bits/basic_ios.h: Use _GLIBCXX_BEGIN_NAMESPACE(std) and friends. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_algobase.h: Same. * include/bits/localefwd.h: Same. * include/bits/valarray_array.tcc: Same. * include/bits/valarray_after.h: Same. * include/bits/gslice_array.h: Same. * include/bits/stl_queue.h: Same. * include/bits/gslice.h: Same. * include/bits/locale_facets.tcc: Same. * include/bits/locale_classes.h: Same. * include/bits/stl_set.h: Same. * include/bits/locale_facets.h: Same. * include/bits/stl_stack.h: Same. * include/bits/stl_iterator_base_types.h: Same. * include/bits/stl_heap.h: Same. * include/bits/indirect_array.h: Same. * include/bits/atomicity.h: Same. * include/bits/stream_iterator.h: Same. * include/bits/concurrence.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_pair.h: Same. * include/bits/basic_ios.tcc: Same. * include/bits/stl_raw_storage_iter.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_numeric.h: Same. * include/bits/ios_base.h: Same. * include/bits/stl_deque.h: Same. * include/bits/istream.tcc: Same. * include/bits/postypes.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/mask_array.h: Same. * include/bits/stl_uninitialized.h: Same. * include/bits/ostream.tcc: Same. * include/bits/slice_array.h: Same. * include/bits/boost_concept_check.h: Same. * include/bits/sstream.tcc: Same. * include/bits/stl_iterator_base_funcs.h: Same. * include/bits/char_traits.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stringfwd.h: Same. * include/bits/c++config * include/bits/stl_iterator.h: Same. * include/bits/valarray_array.h: Same. * include/bits/stl_tempbuf.h: Same. * include/bits/vector.tcc: Same. * include/bits/deque.tcc: Same. * include/bits/stl_bvector.h: Same. * include/bits/basic_string.tcc: Same. * include/bits/list.tcc: Same. * include/bits/streambuf_iterator.h: Same. * include/bits/valarray_before.h: Same. * include/bits/stl_construct.h: Same. * include/bits/stl_function.h: Same. * include/bits/cpp_type_traits.h: Same. * include/bits/streambuf.tcc: Same. * include/bits/allocator.h: Same. * include/bits/stl_tree.h: Same. * include/bits/fstream.tcc: Same. * include/bits/stl_relops.h: Same. * include/bits/functexcept.h: Same. * include/std/std_valarray.h: Same. * include/std/std_iostream.h: Same. * include/std/std_streambuf.h: Same. * include/std/std_bitset.h: Same. * include/std/std_iosfwd.h: Same. * include/std/std_iomanip.h: Same. * include/std/std_fstream.h: Same. * include/std/std_limits.h: Same. * include/std/std_stdexcept.h: Same. * include/std/std_istream.h: Same. * include/std/std_complex.h: Same. * include/std/std_memory.h: Same. * include/std/std_ostream.h: Same. * include/std/std_sstream.h: Same. * include/c_std/std_csignal.h: Same. * include/c_std/std_cstdlib.h: Same. * include/c_std/std_cstdio.h: Same. * include/c_std/std_cstdarg.h: Same. * include/c_std/std_cctype.h: Same. * include/c_std/std_cmath.h: Same. * include/c_std/std_ctime.h: Same. * include/c_std/std_clocale.h: Same. * include/c_std/std_csetjmp.h: Same. * include/c_std/std_cwchar.h: Same. * include/c_std/std_cstring.h: Same. * include/c_std/std_cstddef.h: Same. * include/c_std/std_cwctype.h: Same. * include/backward/iterator.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/strstream * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * src/allocator-inst.cc: Same. * src/complex_io.cc: Same. * src/localename.cc: Same. * src/limits.cc: Same. * src/ios_failure.cc: Same. * src/locale-misc-inst.cc: Same. * src/streambuf-inst.cc: Same. * src/misc-inst.cc: Same. * src/concept-inst.cc: Same. * src/ios_locale.cc: Same. * src/pool_allocator.cc: Same. * src/fstream-inst.cc: Same. * src/istream-inst.cc: Same. * src/string-inst.cc: Same. * src/locale_init.cc: Same. * src/ctype.cc: Same. * src/strstream.cc: Same. * src/ostream-inst.cc: Same. * src/functexcept.cc: Same. * src/streambuf.cc: Same. * src/sstream-inst.cc: Same. * src/ios.cc: Same. * src/valarray-inst.cc: Same. * src/locale.cc: Same. * src/tree.cc: Same. * src/stdexcept.cc: Same. * src/istream.cc: Same. * src/compatibility.cc: Same. * src/locale-inst.cc: Same. * src/globals_io.cc: Same. * src/list.cc: Same. * src/ios_init.cc: Same. * src/locale_facets.cc: Same. * src/codecvt.cc: Same. * include/tr1/unordered_map: Use _GLIBCXX_BEGIN_NAMESPACE(tr1). * include/tr1/boost_shared_ptr.h: Same. * include/tr1/tuple * include/tr1/hashtable * include/tr1/type_traits_fwd.h: Same. * include/tr1/unordered_set * include/tr1/functional * include/tr1/ref_fwd.h: Same. * include/tr1/utility * include/tr1/type_traits * include/tr1/array * include/ext/hashtable.h: Use _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx). * include/ext/typelist.h: Same. * include/ext/hash_map: Same. * include/ext/rc_string_base.h: Same. * include/ext/pool_allocator.h: Same. * include/ext/iterator: Same. * include/ext/rb_tree: Same. * include/ext/numeric: Same. * include/ext/vstring.tcc: Same. * include/ext/sso_string_base.h: Same. * include/ext/stdio_filebuf.h: Same. * include/ext/algorithm: Same. * include/ext/codecvt_specializations.h: Same. * include/ext/new_allocator.h: Same. * include/ext/array_allocator.h: Same. * include/ext/vstring_util.h: Same. * include/ext/vstring_fwd.h: Same. * include/ext/mt_allocator.h: Same. * include/ext/debug_allocator.h: Same. * include/ext/slist: Same. * include/ext/stdio_sync_filebuf.h: Same. * include/ext/hash_fun.h: Same. * include/ext/malloc_allocator.h: Same. * include/ext/functional: Same. * include/ext/bitmap_allocator.h: Same. * include/ext/pod_char_traits.h: Same. * include/ext/vstring.h: Same. * include/ext/ropeimpl.h: Same. * include/ext/hash_set: Same. * include/ext/memory: Same. * include/ext/rope: Same. * include/bits/boost_concept_check.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/char_traits.h: Same. * include/bits/cpp_type_traits.h: Same. * include/bits/concurrence.h: Same. * include/bits/atomicity.h: Same. * config/locale/gnu/numeric_members.cc: Same. * config/locale/gnu/collate_members.cc: Same. * config/locale/gnu/ctype_members.cc: Same. * config/locale/gnu/c_locale.cc: Same. * config/locale/gnu/codecvt_members.cc: Same. * config/locale/gnu/messages_members.cc: Same. * config/locale/gnu/c_locale.h: Same. * config/locale/gnu/monetary_members.cc: Same. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.h: Same. * config/locale/generic/numeric_members.cc: Same. * config/locale/generic/collate_members.cc: Same. * config/locale/generic/ctype_members.cc: Same. * config/locale/generic/c_locale.cc: Same. * config/locale/generic/codecvt_members.cc: Same. * config/locale/generic/messages_members.cc: Same. * config/locale/generic/c_locale.h: Same. * config/locale/generic/monetary_members.cc: Same. * config/locale/generic/time_members.cc: Same. * config/os/aix/atomicity.h: Same. * config/os/irix/atomicity.h: Same. * config/cpu/powerpc/atomicity.h: Same. * config/cpu/cris/atomicity.h: Same. * config/cpu/ia64/atomicity.h: Same. * config/cpu/alpha/atomicity.h: Same. * config/cpu/m68k/atomicity.h: Same. * config/cpu/hppa/atomicity.h: Same. * config/cpu/mips/atomicity.h: Same. * config/cpu/sparc/atomicity.h: Same. * config/cpu/i386/atomicity.h: Same. * config/cpu/i486/atomicity.h: Same. * config/cpu/sh/atomicity.h: Same. * config/cpu/generic/atomicity.h: Same. * config/cpu/s390/atomicity.h: Same. * config/io/c_io_stdio.h: Same. * config/io/basic_file_stdio.cc: Same. * config/io/basic_file_stdio.h: Same. * src/misc-inst.cc: Same. * src/concept-inst.cc: Same. * src/ext-inst.cc: Same. * src/string-inst.cc: Same. * src/pool_allocator.cc: Same. * src/bitmap_allocator.cc: Same. * src/mt_allocator.cc: Same. * libsupc++/exception: Same. * libsupc++/vterminate.cc: Same. * testsuite/ext/hash_map/1.cc: Explicitly qualify __gnu_cxx::hash_map. * testsuite/ext/hash_map/14648.cc: Same. * libsupc++/eh_alloc.cc: Correct comment line spacing. From-SVN: r108775
2005-12-19 01:56:05 +01:00
#if __cplusplus >= 201103L
re PR libstdc++/32618 (std::vector calls uneccessary constructors instead of inplace construction of first object) 2010-06-18 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/32618 * include/bits/stl_list.h (vector<>::_M_default_initialize, _M_default_append): Declare. (list<>::list(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/list.tcc (list<>::resize, _M_default_append): Define. * include/bits/stl_vector.h (vector<>::_M_default_initialize, _M_default_append): Declare. (vector<>::vector(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/vector.tcc (vector<>::_M_default_append): Define. * include/bits/stl_deque.h (deque<>::_M_default_initialize, _M_default_append): Declare. (deque<>::deque(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/deque.tcc (deque<>::_M_default_append): Define. * include/debug/vector: Update. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/bits/forward_list.h (_M_default_initialize, _M_default_insert_after): Declare. (forward_list<>::forward_list(size_type), resize(size_type)): Fix, use the latter. * include/bits/forward_list.tcc (forward_list<>::_M_default_append, _M_default_insert_after): Define. * testsuite/util/testsuite_api.h (NonCopyConstructible): Add. * testsuite/23_containers/forward_list/modifiers/6.cc: Move to... * testsuite/23_containers/forward_list/capacity/resize_size.cc: ... here. * testsuite/23_containers/forward_list/cons/10.cc: Move to... * testsuite/23_containers/forward_list/cons/cons_size.cc: ... here. * testsuite/23_containers/vector/resize/1.cc: Move to... * testsuite/23_containers/vector/capacity/resize/1.cc: ... here. * testsuite/23_containers/vector/resize/moveable.cc: Move to... * testsuite/23_containers/vector/resize/capacity/moveable.cc: ... here. * testsuite/23_containers/vector/cons/cons_size.cc: New. * testsuite/23_containers/vector/capacity/resize/resize_size.cc: Likewise. * testsuite/23_containers/deque/cons/cons_size.cc: Likewise. * testsuite/23_containers/deque/capacity/resize_size.cc: Likewise. * testsuite/23_containers/list/cons/cons_size.cc: Likewise. * testsuite/23_containers/list/capacity/resize_size.cc: Likewise. * testsuite/23_containers/vector/capacity/resize/moveable.cc: Adjust. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r161009
2010-06-18 20:07:45 +02:00
template <typename _Tp, typename _Alloc>
void
deque<_Tp, _Alloc>::
_M_default_initialize()
{
_Map_pointer __cur;
__try
{
for (__cur = this->_M_impl._M_start._M_node;
__cur < this->_M_impl._M_finish._M_node;
++__cur)
std::__uninitialized_default_a(*__cur, *__cur + _S_buffer_size(),
_M_get_Tp_allocator());
std::__uninitialized_default_a(this->_M_impl._M_finish._M_first,
this->_M_impl._M_finish._M_cur,
_M_get_Tp_allocator());
}
__catch(...)
{
std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur),
_M_get_Tp_allocator());
__throw_exception_again;
}
}
#endif
template <typename _Tp, typename _Alloc>
deque<_Tp, _Alloc>&
deque<_Tp, _Alloc>::
operator=(const deque& __x)
{
const size_type __len = size();
if (&__x != this)
{
if (__len >= __x.size())
_M_erase_at_end(std::copy(__x.begin(), __x.end(),
this->_M_impl._M_start));
else
{
const_iterator __mid = __x.begin() + difference_type(__len);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
std::copy(__x.begin(), __mid, this->_M_impl._M_start);
insert(this->_M_impl._M_finish, __mid, __x.end());
}
}
return *this;
}
#if __cplusplus >= 201103L
stl_deque.h (deque<>::push_back(_Args&&...), [...]): Remove. 2008-06-13 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/stl_deque.h (deque<>::push_back(_Args&&...), deque<>::push_front(_Args&&...)): Remove. (deque<>::push_back(value_type&&), deque<>::push_front(value_type&&)): Add. (deque<>::push_back(const value_type&), deque<>::push_front(const value_type&)): Add back. (deque<>::emplace_back(_Args&&...), deque<>::emplace_front(_Args&&...)): Declare... * include/bits/deque.tcc: ... and define. * include/bits/stl_list.h (list<>::push_back(_Args&&...), list<>::push_front(_Args&&...)): Remove. (list<>::push_back(value_type&&), list<>::push_front(value_type&&), list<>::emplace_back(_Args&&...), list<>::emplace_front(_Args&&...)): Add. (list<>::push_back(const value_type&), list<>::push_front(const value_type&)): Add back. * include/bits/stl_vector.h (vector<>::push_back(_Args&&...)): Remove. (vector<>::push_back(value_type&&)): Add. (vector<>::push_back(const value_type&)): Add back. (vector<>::emplace_back(_Args&&...)): Declare... * include/bits/vector.tcc: ... and define. * include/bits/stl_queue.h (queue<>::push(_Args&&...), priority_queue<>::push(_Args&&...)): Remove. (queue<>::push(value_type&&), queue<>::emplace(_Args&&...), priority_queue<>::push(value_type&&), priority_queue<>::emplace(_Args&&...)): Add. (queue<>::push(const value_type&), priority_queue<>::push(const value_type&)): Add back. * include/bits/stl_stack.h (stack<>::push(_Args&&...)): Remove. (stack<>::push(value_type&&), stack<>::emplace(_Args&&...)): Add. (stack<>::push(const value_type&)): Add back. * include/debug/deque (deque<>::push_back(_Args&&...), deque<>::push_front(_Args&&...)): Remove. (deque<>::push_back(value_type&&), deque<>::push_front(value_type&&), deque<>::emplace_back(_Args&&...), deque<>::emplace_front(_Args&&...)): Add. (deque<>::push_back(const value_type&), deque<>::push_front(const value_type&)): Add back. * include/debug/list (list<>::push_back(_Args&&...), list<>::push_front(_Args&&...)): Remove. (list<>::push_back(value_type&&), list<>::push_front(value_type&&), list<>::emplace_back(_Args&&...), list<>::emplace_front(_Args&&...)): Add. (list<>::push_back(const value_type&), list<>::push_front(const value_type&)): Add back. * include/debug/vector (vector<>::push_back(_Args&&...)): Remove. (vector<>::push_back(value_type&&), vector<>::emplace_back(_Args&&...)): Add. (vector<>::push_back(const value_type&)): Add back. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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 numbers. * 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. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. From-SVN: r136750
2008-06-13 14:03:13 +02:00
template<typename _Tp, typename _Alloc>
template<typename... _Args>
void
deque<_Tp, _Alloc>::
emplace_front(_Args&&... __args)
{
if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
{
this->_M_impl.construct(this->_M_impl._M_start._M_cur - 1,
std::forward<_Args>(__args)...);
--this->_M_impl._M_start._M_cur;
}
else
_M_push_front_aux(std::forward<_Args>(__args)...);
}
template<typename _Tp, typename _Alloc>
template<typename... _Args>
void
deque<_Tp, _Alloc>::
emplace_back(_Args&&... __args)
{
if (this->_M_impl._M_finish._M_cur
!= this->_M_impl._M_finish._M_last - 1)
{
this->_M_impl.construct(this->_M_impl._M_finish._M_cur,
std::forward<_Args>(__args)...);
++this->_M_impl._M_finish._M_cur;
}
else
_M_push_back_aux(std::forward<_Args>(__args)...);
}
#endif
#if __cplusplus >= 201103L
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
template<typename _Tp, typename _Alloc>
template<typename... _Args>
typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>::
stl_deque.h (deque<>::insert(iterator, const value_type&), [...]): Adjust C++11 signatures to take a const_iterator. 2013-06-27 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/stl_deque.h (deque<>::insert(iterator, const value_type&), deque<>::insert(iterator, value_type&&), deque<>::emplace(iterator, _Args&&...)): Adjust C++11 signatures to take a const_iterator. (deque<>::erase): Simplify. * include/bits/stl_list.h: Likewise. (_List_iterator<>::_M_const_cast): Add. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. (_Bit_iterator::_M_const_cast): Add. * include/bits/deque.tcc: Adjust definitions. * include/bits/list.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast): Define trivial version in C++98 mode. * include/ext/vstring.h (__versa_string<>::insert(iterator, _CharT), __versa_string<>::replace(iterator, iterator, const __versa_string&), __versa_string<>::replace(iterator, iterator, const _CharT*, size_type), __versa_string<>::replace(iterator, iterator, const _CharT*), __versa_string<>::replace(iterator, iterator, size_type, _CharT)): Adjust C++11 signatures to take a pair of const_iterators. * include/debug/deque: Adjust. * include/debug/list: Likewise. * include/debug/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/profile/vector: Likewise. (vector<>::emplace): Add. * testsuite/util/exception/safety.h: Update. * testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc: New. * testsuite/23_containers/deque/modifiers/insert/const_iterator.cc: Likewise. * testsuite/23_containers/list/modifiers/emplace/const_iterator.cc: Likewise. * testsuite/23_containers/list/modifiers/insert/const_iterator.cc: Likewise. * testsuite/23_containers/vector/bool/modifiers/insert/ const_iterator.cc: Likewise. * testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc: Likewise. * testsuite/23_containers/vector/modifiers/insert/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/char/54577.cc: Move to testsuite/ ext/vstring/modifiers/erase/char/. * testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Move to testsuite/ ext/vstring/modifiers/wchar_t/. * testsuite/ext/vstring/modifiers/char/pop_back.cc: Move to testsuite/ ext/vstring/modifiers/pop_back/char/. * testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc: Move to testsuite/ext/vstring/modifiers/pop_back/wchar_t/. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r200458
2013-06-27 11:51:21 +02:00
emplace(const_iterator __position, _Args&&... __args)
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
{
if (__position._M_cur == this->_M_impl._M_start._M_cur)
{
emplace_front(std::forward<_Args>(__args)...);
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
return this->_M_impl._M_start;
}
else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
{
emplace_back(std::forward<_Args>(__args)...);
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
iterator __tmp = this->_M_impl._M_finish;
--__tmp;
return __tmp;
}
else
stl_deque.h (deque<>::insert(iterator, const value_type&), [...]): Adjust C++11 signatures to take a const_iterator. 2013-06-27 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/stl_deque.h (deque<>::insert(iterator, const value_type&), deque<>::insert(iterator, value_type&&), deque<>::emplace(iterator, _Args&&...)): Adjust C++11 signatures to take a const_iterator. (deque<>::erase): Simplify. * include/bits/stl_list.h: Likewise. (_List_iterator<>::_M_const_cast): Add. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. (_Bit_iterator::_M_const_cast): Add. * include/bits/deque.tcc: Adjust definitions. * include/bits/list.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast): Define trivial version in C++98 mode. * include/ext/vstring.h (__versa_string<>::insert(iterator, _CharT), __versa_string<>::replace(iterator, iterator, const __versa_string&), __versa_string<>::replace(iterator, iterator, const _CharT*, size_type), __versa_string<>::replace(iterator, iterator, const _CharT*), __versa_string<>::replace(iterator, iterator, size_type, _CharT)): Adjust C++11 signatures to take a pair of const_iterators. * include/debug/deque: Adjust. * include/debug/list: Likewise. * include/debug/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/profile/vector: Likewise. (vector<>::emplace): Add. * testsuite/util/exception/safety.h: Update. * testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc: New. * testsuite/23_containers/deque/modifiers/insert/const_iterator.cc: Likewise. * testsuite/23_containers/list/modifiers/emplace/const_iterator.cc: Likewise. * testsuite/23_containers/list/modifiers/insert/const_iterator.cc: Likewise. * testsuite/23_containers/vector/bool/modifiers/insert/ const_iterator.cc: Likewise. * testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc: Likewise. * testsuite/23_containers/vector/modifiers/insert/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/char/54577.cc: Move to testsuite/ ext/vstring/modifiers/erase/char/. * testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Move to testsuite/ ext/vstring/modifiers/wchar_t/. * testsuite/ext/vstring/modifiers/char/pop_back.cc: Move to testsuite/ ext/vstring/modifiers/pop_back/char/. * testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc: Move to testsuite/ext/vstring/modifiers/pop_back/wchar_t/. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r200458
2013-06-27 11:51:21 +02:00
return _M_insert_aux(__position._M_const_cast(),
std::forward<_Args>(__args)...);
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
}
#endif
stl_deque.h (deque<>::insert(iterator, const value_type&), [...]): Adjust C++11 signatures to take a const_iterator. 2013-06-27 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/stl_deque.h (deque<>::insert(iterator, const value_type&), deque<>::insert(iterator, value_type&&), deque<>::emplace(iterator, _Args&&...)): Adjust C++11 signatures to take a const_iterator. (deque<>::erase): Simplify. * include/bits/stl_list.h: Likewise. (_List_iterator<>::_M_const_cast): Add. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. (_Bit_iterator::_M_const_cast): Add. * include/bits/deque.tcc: Adjust definitions. * include/bits/list.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast): Define trivial version in C++98 mode. * include/ext/vstring.h (__versa_string<>::insert(iterator, _CharT), __versa_string<>::replace(iterator, iterator, const __versa_string&), __versa_string<>::replace(iterator, iterator, const _CharT*, size_type), __versa_string<>::replace(iterator, iterator, const _CharT*), __versa_string<>::replace(iterator, iterator, size_type, _CharT)): Adjust C++11 signatures to take a pair of const_iterators. * include/debug/deque: Adjust. * include/debug/list: Likewise. * include/debug/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/profile/vector: Likewise. (vector<>::emplace): Add. * testsuite/util/exception/safety.h: Update. * testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc: New. * testsuite/23_containers/deque/modifiers/insert/const_iterator.cc: Likewise. * testsuite/23_containers/list/modifiers/emplace/const_iterator.cc: Likewise. * testsuite/23_containers/list/modifiers/insert/const_iterator.cc: Likewise. * testsuite/23_containers/vector/bool/modifiers/insert/ const_iterator.cc: Likewise. * testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc: Likewise. * testsuite/23_containers/vector/modifiers/insert/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc: Likewise. * testsuite/ext/vstring/modifiers/char/54577.cc: Move to testsuite/ ext/vstring/modifiers/erase/char/. * testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Move to testsuite/ ext/vstring/modifiers/wchar_t/. * testsuite/ext/vstring/modifiers/char/pop_back.cc: Move to testsuite/ ext/vstring/modifiers/pop_back/char/. * testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc: Move to testsuite/ext/vstring/modifiers/pop_back/wchar_t/. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r200458
2013-06-27 11:51:21 +02:00
template <typename _Tp, typename _Alloc>
typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>::
#if __cplusplus >= 201103L
insert(const_iterator __position, const value_type& __x)
#else
insert(iterator __position, const value_type& __x)
#endif
{
if (__position._M_cur == this->_M_impl._M_start._M_cur)
{
push_front(__x);
return this->_M_impl._M_start;
}
else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
{
push_back(__x);
iterator __tmp = this->_M_impl._M_finish;
--__tmp;
return __tmp;
}
else
return _M_insert_aux(__position._M_const_cast(), __x);
}
template <typename _Tp, typename _Alloc>
typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>::
re PR libstdc++/54577 (deque<T>::erase() still takes iterator instead of const_iterator) 2013-05-10 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/54577 * include/bits/stl_deque.h (erase): Fix signatures in C++11 mode. (_Deque_iterator<>::_M_const_cast): Add. (deque<>::_M_erase): Declare. * include/bits/deque.tcc: ... and define. * include/bits/stl_list.h (erase): Fix signatures in C++11 mode. (_List_const_iterator<>::_M_const_cast): Add. * include/bits/list.tcc (erase (iterator)): Fix. * include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast): Add; include <ext/cast.h>. * include/bits/stl_vector.h (erase): Fix signatures in C++11 mode. (vector<>::_M_erase): Declare. * include/bits/stl_bvector.h: Likewise. * include/bits/vector.tcc (vector<>::_M_erase): Define. * include/ext/vstring.h (erase): Fix signatures in C++11 mode. * include/debug/deque: Adjust. * include/debug/list: Likewise. * include/debug/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/profile/vector: Likewise. * testsuite/util/exception/safety.h (erase_base<deque>, erase_base<deque>, erase_base<vector>): Remove. (erase_base<__versa_string>): Update. * testsuite/ext/vstring/modifiers/char/54577.cc: New. * testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Likewise. * testsuite/23_containers/deque/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/list/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/vector/bool/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/vector/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r198790
2013-05-10 17:18:33 +02:00
_M_erase(iterator __position)
{
iterator __next = __position;
++__next;
const difference_type __index = __position - begin();
if (static_cast<size_type>(__index) < (size() >> 1))
{
if (__position != begin())
_GLIBCXX_MOVE_BACKWARD3(begin(), __position, __next);
pop_front();
}
else
{
if (__next != end())
_GLIBCXX_MOVE3(__next, end(), __position);
pop_back();
}
return begin() + __index;
}
template <typename _Tp, typename _Alloc>
typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>::
re PR libstdc++/54577 (deque<T>::erase() still takes iterator instead of const_iterator) 2013-05-10 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/54577 * include/bits/stl_deque.h (erase): Fix signatures in C++11 mode. (_Deque_iterator<>::_M_const_cast): Add. (deque<>::_M_erase): Declare. * include/bits/deque.tcc: ... and define. * include/bits/stl_list.h (erase): Fix signatures in C++11 mode. (_List_const_iterator<>::_M_const_cast): Add. * include/bits/list.tcc (erase (iterator)): Fix. * include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast): Add; include <ext/cast.h>. * include/bits/stl_vector.h (erase): Fix signatures in C++11 mode. (vector<>::_M_erase): Declare. * include/bits/stl_bvector.h: Likewise. * include/bits/vector.tcc (vector<>::_M_erase): Define. * include/ext/vstring.h (erase): Fix signatures in C++11 mode. * include/debug/deque: Adjust. * include/debug/list: Likewise. * include/debug/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/profile/vector: Likewise. * testsuite/util/exception/safety.h (erase_base<deque>, erase_base<deque>, erase_base<vector>): Remove. (erase_base<__versa_string>): Update. * testsuite/ext/vstring/modifiers/char/54577.cc: New. * testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Likewise. * testsuite/23_containers/deque/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/list/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/vector/bool/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/vector/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r198790
2013-05-10 17:18:33 +02:00
_M_erase(iterator __first, iterator __last)
{
if (__first == __last)
return __first;
else if (__first == begin() && __last == end())
{
clear();
return end();
}
else
{
const difference_type __n = __last - __first;
const difference_type __elems_before = __first - begin();
if (static_cast<size_type>(__elems_before) <= (size() - __n) / 2)
{
if (__first != begin())
_GLIBCXX_MOVE_BACKWARD3(begin(), __first, __last);
_M_erase_at_begin(begin() + __n);
}
else
{
if (__last != end())
_GLIBCXX_MOVE3(__last, end(), __first);
_M_erase_at_end(end() - __n);
}
return begin() + __elems_before;
}
}
template <typename _Tp, class _Alloc>
template <typename _InputIterator>
void
[multiple changes] 2005-06-06 Paolo Carlini <pcarlini@suse.de> Port from libstdcxx_so_7-branch: 2004-09-24 Paolo Carlini <pcarlini@suse.de> Jonathan Wakely <redi@gcc.gnu.org> * include/bits/stl_list.h (list::list(size_type, value_type, const allocator_type&): Implement according to the letter of the standard, i.e., don't use two overloads, not equivalent in case of non default constructible T. (list::resize(size_type, const value_type&)): Fix the signature: according to the standard the second argument is by value; also, don't use two overloads. * include/bits/list.tcc (list::resize(size_type, const value_type&)): Adjust consistently the signature. * include/bits/stl_deque.h (deque::deque(size_type, value_type, const allocator_type&)): Likewise. (deque::resize(size_type, const value_type&)): Likewise. * include/bits/stl_vector.h (vector::vector(size_type, value_type, const allocator_type&)): Likewise. (vector::resize(size_type, const value_type&)): Likewise. * testsuite/testsuite_hooks.h: Add NonDefaultConstructible test type. * testsuite/23_containers/deque/explicit_instantiation/2.cc: New. * testsuite/23_containers/list/explicit_instantiation/2.cc: New. * testsuite/23_containers/map/explicit_instantiation/2.cc: New. * testsuite/23_containers/multimap/explicit_instantiation/2.cc: New. * testsuite/23_containers/multiset/explicit_instantiation/2.cc: New. * testsuite/23_containers/set/explicit_instantiation/2.cc: New. * testsuite/23_containers/vector/explicit_instantiation/2.cc: New. * include/bits/deque.tcc: Minor formatting fix. From-SVN: r100668
2005-06-06 18:59:55 +02:00
deque<_Tp, _Alloc>::
_M_assign_aux(_InputIterator __first, _InputIterator __last,
std::input_iterator_tag)
{
iterator __cur = begin();
for (; __first != __last && __cur != end(); ++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
_M_erase_at_end(__cur);
else
insert(end(), __first, __last);
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp, _Alloc>::
_M_fill_insert(iterator __pos, size_type __n, const value_type& __x)
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
if (__pos._M_cur == this->_M_impl._M_start._M_cur)
{
iterator __new_start = _M_reserve_elements_at_front(__n);
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
std::__uninitialized_fill_a(__new_start, this->_M_impl._M_start,
__x, _M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_start = __new_start;
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
_M_destroy_nodes(__new_start._M_node,
this->_M_impl._M_start._M_node);
__throw_exception_again;
}
}
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
{
iterator __new_finish = _M_reserve_elements_at_back(__n);
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
std::__uninitialized_fill_a(this->_M_impl._M_finish,
__new_finish, __x,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_finish = __new_finish;
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
_M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
__new_finish._M_node + 1);
__throw_exception_again;
}
}
else
_M_insert_aux(__pos, __n, __x);
}
#if __cplusplus >= 201103L
re PR libstdc++/32618 (std::vector calls uneccessary constructors instead of inplace construction of first object) 2010-06-18 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/32618 * include/bits/stl_list.h (vector<>::_M_default_initialize, _M_default_append): Declare. (list<>::list(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/list.tcc (list<>::resize, _M_default_append): Define. * include/bits/stl_vector.h (vector<>::_M_default_initialize, _M_default_append): Declare. (vector<>::vector(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/vector.tcc (vector<>::_M_default_append): Define. * include/bits/stl_deque.h (deque<>::_M_default_initialize, _M_default_append): Declare. (deque<>::deque(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/deque.tcc (deque<>::_M_default_append): Define. * include/debug/vector: Update. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/bits/forward_list.h (_M_default_initialize, _M_default_insert_after): Declare. (forward_list<>::forward_list(size_type), resize(size_type)): Fix, use the latter. * include/bits/forward_list.tcc (forward_list<>::_M_default_append, _M_default_insert_after): Define. * testsuite/util/testsuite_api.h (NonCopyConstructible): Add. * testsuite/23_containers/forward_list/modifiers/6.cc: Move to... * testsuite/23_containers/forward_list/capacity/resize_size.cc: ... here. * testsuite/23_containers/forward_list/cons/10.cc: Move to... * testsuite/23_containers/forward_list/cons/cons_size.cc: ... here. * testsuite/23_containers/vector/resize/1.cc: Move to... * testsuite/23_containers/vector/capacity/resize/1.cc: ... here. * testsuite/23_containers/vector/resize/moveable.cc: Move to... * testsuite/23_containers/vector/resize/capacity/moveable.cc: ... here. * testsuite/23_containers/vector/cons/cons_size.cc: New. * testsuite/23_containers/vector/capacity/resize/resize_size.cc: Likewise. * testsuite/23_containers/deque/cons/cons_size.cc: Likewise. * testsuite/23_containers/deque/capacity/resize_size.cc: Likewise. * testsuite/23_containers/list/cons/cons_size.cc: Likewise. * testsuite/23_containers/list/capacity/resize_size.cc: Likewise. * testsuite/23_containers/vector/capacity/resize/moveable.cc: Adjust. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r161009
2010-06-18 20:07:45 +02:00
template <typename _Tp, typename _Alloc>
void
deque<_Tp, _Alloc>::
_M_default_append(size_type __n)
{
if (__n)
{
iterator __new_finish = _M_reserve_elements_at_back(__n);
__try
{
std::__uninitialized_default_a(this->_M_impl._M_finish,
__new_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish = __new_finish;
}
__catch(...)
{
_M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
__new_finish._M_node + 1);
__throw_exception_again;
}
}
}
template <typename _Tp, typename _Alloc>
bool
deque<_Tp, _Alloc>::
_M_shrink_to_fit()
{
const difference_type __front_capacity
= (this->_M_impl._M_start._M_cur - this->_M_impl._M_start._M_first);
if (__front_capacity == 0)
return false;
const difference_type __back_capacity
= (this->_M_impl._M_finish._M_last - this->_M_impl._M_finish._M_cur);
if (__front_capacity + __back_capacity < _S_buffer_size())
return false;
return std::__shrink_to_fit_aux<deque>::_S_do_it(*this);
}
re PR libstdc++/32618 (std::vector calls uneccessary constructors instead of inplace construction of first object) 2010-06-18 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/32618 * include/bits/stl_list.h (vector<>::_M_default_initialize, _M_default_append): Declare. (list<>::list(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/list.tcc (list<>::resize, _M_default_append): Define. * include/bits/stl_vector.h (vector<>::_M_default_initialize, _M_default_append): Declare. (vector<>::vector(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/vector.tcc (vector<>::_M_default_append): Define. * include/bits/stl_deque.h (deque<>::_M_default_initialize, _M_default_append): Declare. (deque<>::deque(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/deque.tcc (deque<>::_M_default_append): Define. * include/debug/vector: Update. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/bits/forward_list.h (_M_default_initialize, _M_default_insert_after): Declare. (forward_list<>::forward_list(size_type), resize(size_type)): Fix, use the latter. * include/bits/forward_list.tcc (forward_list<>::_M_default_append, _M_default_insert_after): Define. * testsuite/util/testsuite_api.h (NonCopyConstructible): Add. * testsuite/23_containers/forward_list/modifiers/6.cc: Move to... * testsuite/23_containers/forward_list/capacity/resize_size.cc: ... here. * testsuite/23_containers/forward_list/cons/10.cc: Move to... * testsuite/23_containers/forward_list/cons/cons_size.cc: ... here. * testsuite/23_containers/vector/resize/1.cc: Move to... * testsuite/23_containers/vector/capacity/resize/1.cc: ... here. * testsuite/23_containers/vector/resize/moveable.cc: Move to... * testsuite/23_containers/vector/resize/capacity/moveable.cc: ... here. * testsuite/23_containers/vector/cons/cons_size.cc: New. * testsuite/23_containers/vector/capacity/resize/resize_size.cc: Likewise. * testsuite/23_containers/deque/cons/cons_size.cc: Likewise. * testsuite/23_containers/deque/capacity/resize_size.cc: Likewise. * testsuite/23_containers/list/cons/cons_size.cc: Likewise. * testsuite/23_containers/list/capacity/resize_size.cc: Likewise. * testsuite/23_containers/vector/capacity/resize/moveable.cc: Adjust. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r161009
2010-06-18 20:07:45 +02:00
#endif
template <typename _Tp, typename _Alloc>
void
deque<_Tp, _Alloc>::
_M_fill_initialize(const value_type& __value)
{
_Map_pointer __cur;
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
for (__cur = this->_M_impl._M_start._M_node;
__cur < this->_M_impl._M_finish._M_node;
cp-tree.h (lang_type_class): Remove is_partial_instantiation. * cp-tree.h (lang_type_class): Remove is_partial_instantiation. (PARTIAL_INSTANTIATION_P): Remove. (IMPLICIT_TYPENAME_P): Likewise. (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise. (build_typename_type): Remove declaration. (parmlist_is_exprlist): Likewise. * decl.c (build_typename_type): Make it static, remove third parameter. (push_class_binding): Don't do implicit typename stuff. (make_typename_type): Likewise. (lookup_name_real): Likewise. (grokdeclarator): Don't try to convert declarations into initializations. Don't do implicit typename stuff. (parmlist_is_exprlist): Remove. (xref_basetypes): Simplify. * decl2.c (grokfield): Don't try to convert declarations into initializations. (build_anon_union_vars): Do this while processing templates, too. (finish_anon_union): Likewise. * error.c (dump_type): Remove implicit typename handling. * parser.c (cp_parser_diagnose_invalid_type_name): New method. (cp_parser_primary_expression): Correct handling of names not found by unqualified name lookup in templates. (cp_parser_nested_name_specifier_opt): Avoid checking dependency of types when possible. (cp_parser_simple_declaration): Complain intelligently about some invalid declarations. (cp_parser_member_declaration): Likewise. (cp_parser_constructor_declarator_p): Don't check when we're in a function scope. * pt.c (instantiate_class_template): Remove PARTIAL_INSTANTIATION_P gunk. * search.c (lookup_field_r): Don't build implicit typenames. (marked_pushdecls_p): Don't enter dependent base types. (unmarked_pushdecls_p): Likewise. * semantics.c (begin_class_definition): Remove implicit typename stuff. * config/locale/gnu/messages_members.h: Use this-> to refer to unqualified members of base clasess. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Likewise. * include/bits/codecvt.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/fstream.tcc: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/list.tcc: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/sstream.tcc: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/stdio_filebuf.h: Likewise. * include/ext/stl_rope.h: Likewise. * include/std/std_fstream.h: Likewise. * include/std/std_sstream.h: Likewise. Co-Authored-By: Jeffrey Oldham <oldham@codesourcery.com> From-SVN: r61403
2003-01-16 21:30:50 +01:00
++__cur)
std::__uninitialized_fill_a(*__cur, *__cur + _S_buffer_size(),
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
__value, _M_get_Tp_allocator());
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
std::__uninitialized_fill_a(this->_M_impl._M_finish._M_first,
this->_M_impl._M_finish._M_cur,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
__value, _M_get_Tp_allocator());
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur),
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
__throw_exception_again;
}
}
template <typename _Tp, typename _Alloc>
template <typename _InputIterator>
void
deque<_Tp, _Alloc>::
_M_range_initialize(_InputIterator __first, _InputIterator __last,
std::input_iterator_tag)
{
this->_M_initialize_map(0);
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
for (; __first != __last; ++__first)
#if __cplusplus >= 201103L
emplace_back(*__first);
#else
push_back(*__first);
#endif
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
clear();
__throw_exception_again;
}
}
template <typename _Tp, typename _Alloc>
template <typename _ForwardIterator>
void
deque<_Tp, _Alloc>::
_M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
std::forward_iterator_tag)
{
const size_type __n = std::distance(__first, __last);
this->_M_initialize_map(__n);
_Map_pointer __cur_node;
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
for (__cur_node = this->_M_impl._M_start._M_node;
__cur_node < this->_M_impl._M_finish._M_node;
++__cur_node)
re PR libstdc++/29134 (Has there been a serious attempt to define the max_size() member functions?) 2006-09-20 Paolo Carlini <pcarlini@suse.de> PR libstdc++/29134 * include/bits/stl_list.h (list<>::max_size): Forward to allocator' max_size. * include/bits/stl_vector.h (vector<>::max_size): Likewise. * include/bits/stl_deque.h (deque<>::max_size): Likewise. * include/bits/stl_tree.h (_Rb_tree<>::max_size): Likewise. * include/tr1/hashtable (_Hashtable<>::max_size): Likewise. * testsuite/23_containers/vector/capacity/29134.cc: Add. * testsuite/23_containers/deque/capacity/29134.cc: Likewise. * testsuite/23_containers/list/capacity/29134.cc: Likewise. * testsuite/23_containers/set/capacity/29134.cc: Likewise. * testsuite/23_containers/map/capacity/29134.cc: Likewise. * testsuite/23_containers/multiset/capacity/29134.cc: Likewise. * testsuite/23_containers/multimap/capacity/29134.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-set.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-map.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-multiset.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-multimap.cc: Likewise. * include/bits/deque.tcc (deque<>::_M_new_elements_at_front, deque<>::_M_new_elements_at_back): Check for length errors. * testsuite/23_containers/deque/capacity/29134-2.cc: New. * testsuite/23_containers/vector/capacity/29134-2.cc: Likewise. * include/tr1/hashtable (_Hashtable<>::_M_get_Value_allocator): Add. (_Hashtable<>::_M_allocate_node, _M_deallocate_node): Use it. * testsuite/tr1/6_containers/unordered/instantiate/set.cc: Add test. * testsuite/tr1/6_containers/unordered/instantiate/map.cc: Likewise. * testsuite/tr1/6_containers/unordered/instantiate/multiset.cc: Likewise. * testsuite/tr1/6_containers/unordered/instantiate/multimap.cc: Likewise. From-SVN: r117099
2006-09-21 02:11:52 +02:00
{
_ForwardIterator __mid = __first;
std::advance(__mid, _S_buffer_size());
std::__uninitialized_copy_a(__first, __mid, *__cur_node,
_M_get_Tp_allocator());
__first = __mid;
}
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
std::__uninitialized_copy_a(__first, __last,
this->_M_impl._M_finish._M_first,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
std::_Destroy(this->_M_impl._M_start,
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
iterator(*__cur_node, __cur_node),
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
__throw_exception_again;
}
}
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
// Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_last - 1.
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
template<typename _Tp, typename _Alloc>
#if __cplusplus >= 201103L
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
template<typename... _Args>
void
deque<_Tp, _Alloc>::
_M_push_back_aux(_Args&&... __args)
#else
void
deque<_Tp, _Alloc>::
_M_push_back_aux(const value_type& __t)
#endif
{
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
_M_reserve_map_at_back();
*(this->_M_impl._M_finish._M_node + 1) = this->_M_allocate_node();
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
{
#if __cplusplus >= 201103L
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
this->_M_impl.construct(this->_M_impl._M_finish._M_cur,
std::forward<_Args>(__args)...);
#else
this->_M_impl.construct(this->_M_impl._M_finish._M_cur, __t);
#endif
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node
+ 1);
this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first;
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
{
_M_deallocate_node(*(this->_M_impl._M_finish._M_node + 1));
__throw_exception_again;
}
}
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
// Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_first.
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
template<typename _Tp, typename _Alloc>
#if __cplusplus >= 201103L
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
template<typename... _Args>
void
deque<_Tp, _Alloc>::
_M_push_front_aux(_Args&&... __args)
#else
void
deque<_Tp, _Alloc>::
_M_push_front_aux(const value_type& __t)
#endif
{
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
_M_reserve_map_at_front();
*(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node();
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
{
this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node
- 1);
this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1;
#if __cplusplus >= 201103L
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
this->_M_impl.construct(this->_M_impl._M_start._M_cur,
std::forward<_Args>(__args)...);
#else
this->_M_impl.construct(this->_M_impl._M_start._M_cur, __t);
#endif
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
{
++this->_M_impl._M_start;
_M_deallocate_node(*(this->_M_impl._M_start._M_node - 1));
__throw_exception_again;
}
}
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
// Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_first.
template <typename _Tp, typename _Alloc>
void deque<_Tp, _Alloc>::
_M_pop_back_aux()
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
_M_deallocate_node(this->_M_impl._M_finish._M_first);
this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node - 1);
this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_last - 1;
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
this->_M_impl.destroy(this->_M_impl._M_finish._M_cur);
}
// Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_last - 1.
// Note that if the deque has at least one element (a precondition for this
// member function), and if
// _M_impl._M_start._M_cur == _M_impl._M_start._M_last,
// then the deque must have at least two nodes.
template <typename _Tp, typename _Alloc>
void deque<_Tp, _Alloc>::
_M_pop_front_aux()
{
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
this->_M_impl.destroy(this->_M_impl._M_start._M_cur);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
_M_deallocate_node(this->_M_impl._M_start._M_first);
this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node + 1);
this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_first;
}
template <typename _Tp, typename _Alloc>
template <typename _InputIterator>
void
deque<_Tp, _Alloc>::
_M_range_insert_aux(iterator __pos,
_InputIterator __first, _InputIterator __last,
std::input_iterator_tag)
{ std::copy(__first, __last, std::inserter(*this, __pos)); }
template <typename _Tp, typename _Alloc>
template <typename _ForwardIterator>
void
deque<_Tp, _Alloc>::
_M_range_insert_aux(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
std::forward_iterator_tag)
{
const size_type __n = std::distance(__first, __last);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
if (__pos._M_cur == this->_M_impl._M_start._M_cur)
{
iterator __new_start = _M_reserve_elements_at_front(__n);
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
std::__uninitialized_copy_a(__first, __last, __new_start,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_start = __new_start;
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
_M_destroy_nodes(__new_start._M_node,
this->_M_impl._M_start._M_node);
__throw_exception_again;
}
}
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
else if (__pos._M_cur == this->_M_impl._M_finish._M_cur)
{
iterator __new_finish = _M_reserve_elements_at_back(__n);
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
std::__uninitialized_copy_a(__first, __last,
this->_M_impl._M_finish,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_finish = __new_finish;
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
_M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
__new_finish._M_node + 1);
__throw_exception_again;
}
}
else
_M_insert_aux(__pos, __first, __last, __n);
}
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
template<typename _Tp, typename _Alloc>
#if __cplusplus >= 201103L
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
template<typename... _Args>
typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>::
_M_insert_aux(iterator __pos, _Args&&... __args)
{
value_type __x_copy(std::forward<_Args>(__args)...); // XXX copy
#else
typename deque<_Tp, _Alloc>::iterator
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
deque<_Tp, _Alloc>::
_M_insert_aux(iterator __pos, const value_type& __x)
{
value_type __x_copy = __x; // XXX copy
#endif
difference_type __index = __pos - this->_M_impl._M_start;
if (static_cast<size_type>(__index) < size() / 2)
{
push_front(_GLIBCXX_MOVE(front()));
iterator __front1 = this->_M_impl._M_start;
++__front1;
iterator __front2 = __front1;
++__front2;
__pos = this->_M_impl._M_start + __index;
iterator __pos1 = __pos;
++__pos1;
_GLIBCXX_MOVE3(__front2, __pos1, __front1);
}
else
{
push_back(_GLIBCXX_MOVE(back()));
iterator __back1 = this->_M_impl._M_finish;
--__back1;
iterator __back2 = __back1;
--__back2;
__pos = this->_M_impl._M_start + __index;
_GLIBCXX_MOVE_BACKWARD3(__pos, __back2, __back1);
}
*__pos = _GLIBCXX_MOVE(__x_copy);
return __pos;
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp, _Alloc>::
_M_insert_aux(iterator __pos, size_type __n, const value_type& __x)
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
const difference_type __elems_before = __pos - this->_M_impl._M_start;
const size_type __length = this->size();
value_type __x_copy = __x;
if (__elems_before < difference_type(__length / 2))
{
iterator __new_start = _M_reserve_elements_at_front(__n);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
iterator __old_start = this->_M_impl._M_start;
__pos = this->_M_impl._M_start + __elems_before;
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
if (__elems_before >= difference_type(__n))
{
iterator __start_n = (this->_M_impl._M_start
+ difference_type(__n));
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
std::__uninitialized_move_a(this->_M_impl._M_start,
__start_n, __new_start,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_start = __new_start;
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
_GLIBCXX_MOVE3(__start_n, __pos, __old_start);
std::fill(__pos - difference_type(__n), __pos, __x_copy);
}
else
{
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
std::__uninitialized_move_fill(this->_M_impl._M_start,
__pos, __new_start,
this->_M_impl._M_start,
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
__x_copy,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_start = __new_start;
std::fill(__old_start, __pos, __x_copy);
}
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
_M_destroy_nodes(__new_start._M_node,
this->_M_impl._M_start._M_node);
__throw_exception_again;
}
}
else
{
iterator __new_finish = _M_reserve_elements_at_back(__n);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
iterator __old_finish = this->_M_impl._M_finish;
const difference_type __elems_after =
difference_type(__length) - __elems_before;
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
__pos = this->_M_impl._M_finish - __elems_after;
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
if (__elems_after > difference_type(__n))
{
iterator __finish_n = (this->_M_impl._M_finish
- difference_type(__n));
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
std::__uninitialized_move_a(__finish_n,
this->_M_impl._M_finish,
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
this->_M_impl._M_finish,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_finish = __new_finish;
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
_GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
std::fill(__pos, __pos + difference_type(__n), __x_copy);
}
else
{
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
std::__uninitialized_fill_move(this->_M_impl._M_finish,
__pos + difference_type(__n),
__x_copy, __pos,
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
this->_M_impl._M_finish,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_finish = __new_finish;
std::fill(__pos, __old_finish, __x_copy);
}
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
_M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
__new_finish._M_node + 1);
__throw_exception_again;
}
}
}
template <typename _Tp, typename _Alloc>
template <typename _ForwardIterator>
void
deque<_Tp, _Alloc>::
_M_insert_aux(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
size_type __n)
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
const difference_type __elemsbefore = __pos - this->_M_impl._M_start;
const size_type __length = size();
if (static_cast<size_type>(__elemsbefore) < __length / 2)
{
iterator __new_start = _M_reserve_elements_at_front(__n);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
iterator __old_start = this->_M_impl._M_start;
__pos = this->_M_impl._M_start + __elemsbefore;
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
if (__elemsbefore >= difference_type(__n))
{
iterator __start_n = (this->_M_impl._M_start
+ difference_type(__n));
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
std::__uninitialized_move_a(this->_M_impl._M_start,
__start_n, __new_start,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_start = __new_start;
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
_GLIBCXX_MOVE3(__start_n, __pos, __old_start);
std::copy(__first, __last, __pos - difference_type(__n));
}
else
{
_ForwardIterator __mid = __first;
std::advance(__mid, difference_type(__n) - __elemsbefore);
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
std::__uninitialized_move_copy(this->_M_impl._M_start,
__pos, __first, __mid,
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
__new_start,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_start = __new_start;
std::copy(__mid, __last, __old_start);
}
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
_M_destroy_nodes(__new_start._M_node,
this->_M_impl._M_start._M_node);
__throw_exception_again;
}
}
else
{
iterator __new_finish = _M_reserve_elements_at_back(__n);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
iterator __old_finish = this->_M_impl._M_finish;
const difference_type __elemsafter =
difference_type(__length) - __elemsbefore;
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
__pos = this->_M_impl._M_finish - __elemsafter;
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
if (__elemsafter > difference_type(__n))
{
iterator __finish_n = (this->_M_impl._M_finish
- difference_type(__n));
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
std::__uninitialized_move_a(__finish_n,
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
this->_M_impl._M_finish,
this->_M_impl._M_finish,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_finish = __new_finish;
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
_GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
std::copy(__first, __last, __pos);
}
else
{
_ForwardIterator __mid = __first;
std::advance(__mid, __elemsafter);
stl_deque.h (deque<>::push_back<>(_Args...), [...]): Add. 2007-11-12 Chris Jefferson <chris@bubblescope.net> Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Add. * include/deque/deque.tcc (insert(iterator, value_type&&), emplace<>(iterator, _Args...), _M_push_back_aux<>(_Args&&...), _M_push_front_aux<>(_Args&&...), _M_insert_aux<>(iterator, _Args&&...)): Define. (_M_insert_aux(iterator, size_type, const value_type&), _M_insert_aux<>(iterator, _ForwardIterator, _ForwardIterator, size_type)): Use _GLIBCXX_MOVE3, _GLIBCXX_MOVE_BACKWARD3, __uninitialized_move*, __uninitialized_fill_move, __uninitialized_copy_move, when possible. * include/bits/stl_uninitialized.h (__uninitialized_copy_copy, __uninitialized_fill_copy, __uninitialized_copy_fill): Remove. (__uninitialized_copy_move, __uninitialized_move_copy, __uninitialized_move_fill, __uninitialized_fill_move): Add. * include/debug/deque (deque<>::push_back<>(_Args...), deque<>::push_front<>(_Args...), emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add. * testsuite/23_containers/deque/modifiers/moveable.cc: Enable. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/deque/cons/moveable.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. * include/debug/vector (vector<>::insert(iterator, _Tp&&)): Minor tweak, prefer std::move. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> From-SVN: r130102
2007-11-12 17:01:09 +01:00
std::__uninitialized_copy_move(__mid, __last, __pos,
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_finish,
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
this->_M_impl._M_finish,
re PR libstdc++/21770 (rebinding allocator::value type vs. container::value_type) 2005-06-03 Paolo Carlini <pcarlini@suse.de> PR libstdc++/21770 * include/bits/stl_deque.h: Add concept-check. In class _Deque_base rebind _Alloc to _Tp_alloc_type, change _Deque_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/deque.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_list.h: Add concept-check. In class _List_base rebind _Alloc to _Tp_alloc_type and add _M_get_Tp_allocator(), which returns the allocator (of type _Node_alloc_type) converted to _Tp_alloc_type. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/list.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_vector.h: Add concept-check. In class _Vector_base rebind _Alloc to _Tp_alloc_type, change _Vector_impl to inherit from the latter and add _M_get_Tp_allocator() which returns it. Use everywhere _M_get_Tp_allocator() instead of get_allocator(). * include/bits/vector.tcc: Likewise, use _M_get_Tp_allocator(). * include/bits/stl_map.h: Add concept-check. Rebind _Alloc to _Pair_alloc_type and use it for _Rb_tree. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Add concept-check. Rebind _Alloc to _Key_alloc_type and use it for _Rb_tree. * include/bits/stl_set.h: Likewise. * include/bits/basic_string.h: Rebind _Alloc to _CharT_alloc_type and use it for the allocator typedefs. * testsuite/21_strings/basic_string/1.cc: New. * testsuite/23_containers/deque/explicit_instantiation.cc: Move to... * testsuite/23_containers/deque/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/deque/explicit_instantiation/3.cc: New. * testsuite/23_containers/list/explicit_instantiation.cc: Move to... * testsuite/23_containers/list/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/list/explicit_instantiation/3.cc: New. * testsuite/23_containers/map/explicit_instantiation.cc: Move to... * testsuite/23_containers/map/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/map/explicit_instantiation/3.cc: New. * testsuite/23_containers/multimap/explicit_instantiation.cc: Move to... * testsuite/23_containers/multimap/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multimap/explicit_instantiation/3.cc: New. * testsuite/23_containers/multiset/explicit_instantiation.cc: Move to... * testsuite/23_containers/multiset/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/multiset/explicit_instantiation/3.cc: New. * testsuite/23_containers/set/explicit_instantiation.cc: Move to... * testsuite/23_containers/set/explicit_instantiation/1.cc: .. here. * testsuite/23_containers/set/explicit_instantiation/3.cc: New. * testsuite/23_containers/vector/explicit_instantiation.cc: Move to... * testsuite/23_containers/vector/explicit_instantiation/1.cc: ... here. * testsuite/23_containers/vector/explicit_instantiation/3.cc: New. From-SVN: r100546
2005-06-03 19:07:48 +02:00
_M_get_Tp_allocator());
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_finish = __new_finish;
std::copy(__first, __mid, __pos);
}
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
_M_destroy_nodes(this->_M_impl._M_finish._M_node + 1,
cp-tree.h (lang_type_class): Remove is_partial_instantiation. * cp-tree.h (lang_type_class): Remove is_partial_instantiation. (PARTIAL_INSTANTIATION_P): Remove. (IMPLICIT_TYPENAME_P): Likewise. (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise. (build_typename_type): Remove declaration. (parmlist_is_exprlist): Likewise. * decl.c (build_typename_type): Make it static, remove third parameter. (push_class_binding): Don't do implicit typename stuff. (make_typename_type): Likewise. (lookup_name_real): Likewise. (grokdeclarator): Don't try to convert declarations into initializations. Don't do implicit typename stuff. (parmlist_is_exprlist): Remove. (xref_basetypes): Simplify. * decl2.c (grokfield): Don't try to convert declarations into initializations. (build_anon_union_vars): Do this while processing templates, too. (finish_anon_union): Likewise. * error.c (dump_type): Remove implicit typename handling. * parser.c (cp_parser_diagnose_invalid_type_name): New method. (cp_parser_primary_expression): Correct handling of names not found by unqualified name lookup in templates. (cp_parser_nested_name_specifier_opt): Avoid checking dependency of types when possible. (cp_parser_simple_declaration): Complain intelligently about some invalid declarations. (cp_parser_member_declaration): Likewise. (cp_parser_constructor_declarator_p): Don't check when we're in a function scope. * pt.c (instantiate_class_template): Remove PARTIAL_INSTANTIATION_P gunk. * search.c (lookup_field_r): Don't build implicit typenames. (marked_pushdecls_p): Don't enter dependent base types. (unmarked_pushdecls_p): Likewise. * semantics.c (begin_class_definition): Remove implicit typename stuff. * config/locale/gnu/messages_members.h: Use this-> to refer to unqualified members of base clasess. * config/locale/ieee_1003.1-2001/codecvt_specializations.h: Likewise. * include/bits/codecvt.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/fstream.tcc: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/list.tcc: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/sstream.tcc: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/stdio_filebuf.h: Likewise. * include/ext/stl_rope.h: Likewise. * include/std/std_fstream.h: Likewise. * include/std/std_sstream.h: Likewise. Co-Authored-By: Jeffrey Oldham <oldham@codesourcery.com> From-SVN: r61403
2003-01-16 21:30:50 +01:00
__new_finish._M_node + 1);
__throw_exception_again;
}
}
}
template<typename _Tp, typename _Alloc>
void
deque<_Tp, _Alloc>::
_M_destroy_data_aux(iterator __first, iterator __last)
{
for (_Map_pointer __node = __first._M_node + 1;
__node < __last._M_node; ++__node)
std::_Destroy(*__node, *__node + _S_buffer_size(),
_M_get_Tp_allocator());
if (__first._M_node != __last._M_node)
{
std::_Destroy(__first._M_cur, __first._M_last,
_M_get_Tp_allocator());
std::_Destroy(__last._M_first, __last._M_cur,
_M_get_Tp_allocator());
}
else
std::_Destroy(__first._M_cur, __last._M_cur,
_M_get_Tp_allocator());
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp, _Alloc>::
_M_new_elements_at_front(size_type __new_elems)
{
re PR libstdc++/29134 (Has there been a serious attempt to define the max_size() member functions?) 2006-09-20 Paolo Carlini <pcarlini@suse.de> PR libstdc++/29134 * include/bits/stl_list.h (list<>::max_size): Forward to allocator' max_size. * include/bits/stl_vector.h (vector<>::max_size): Likewise. * include/bits/stl_deque.h (deque<>::max_size): Likewise. * include/bits/stl_tree.h (_Rb_tree<>::max_size): Likewise. * include/tr1/hashtable (_Hashtable<>::max_size): Likewise. * testsuite/23_containers/vector/capacity/29134.cc: Add. * testsuite/23_containers/deque/capacity/29134.cc: Likewise. * testsuite/23_containers/list/capacity/29134.cc: Likewise. * testsuite/23_containers/set/capacity/29134.cc: Likewise. * testsuite/23_containers/map/capacity/29134.cc: Likewise. * testsuite/23_containers/multiset/capacity/29134.cc: Likewise. * testsuite/23_containers/multimap/capacity/29134.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-set.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-map.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-multiset.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-multimap.cc: Likewise. * include/bits/deque.tcc (deque<>::_M_new_elements_at_front, deque<>::_M_new_elements_at_back): Check for length errors. * testsuite/23_containers/deque/capacity/29134-2.cc: New. * testsuite/23_containers/vector/capacity/29134-2.cc: Likewise. * include/tr1/hashtable (_Hashtable<>::_M_get_Value_allocator): Add. (_Hashtable<>::_M_allocate_node, _M_deallocate_node): Use it. * testsuite/tr1/6_containers/unordered/instantiate/set.cc: Add test. * testsuite/tr1/6_containers/unordered/instantiate/map.cc: Likewise. * testsuite/tr1/6_containers/unordered/instantiate/multiset.cc: Likewise. * testsuite/tr1/6_containers/unordered/instantiate/multimap.cc: Likewise. From-SVN: r117099
2006-09-21 02:11:52 +02:00
if (this->max_size() - this->size() < __new_elems)
__throw_length_error(__N("deque::_M_new_elements_at_front"));
const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
/ _S_buffer_size());
_M_reserve_map_at_front(__new_nodes);
size_type __i;
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
for (__i = 1; __i <= __new_nodes; ++__i)
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
*(this->_M_impl._M_start._M_node - __i) = this->_M_allocate_node();
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
for (size_type __j = 1; __j < __i; ++__j)
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
_M_deallocate_node(*(this->_M_impl._M_start._M_node - __j));
__throw_exception_again;
}
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp, _Alloc>::
_M_new_elements_at_back(size_type __new_elems)
{
re PR libstdc++/29134 (Has there been a serious attempt to define the max_size() member functions?) 2006-09-20 Paolo Carlini <pcarlini@suse.de> PR libstdc++/29134 * include/bits/stl_list.h (list<>::max_size): Forward to allocator' max_size. * include/bits/stl_vector.h (vector<>::max_size): Likewise. * include/bits/stl_deque.h (deque<>::max_size): Likewise. * include/bits/stl_tree.h (_Rb_tree<>::max_size): Likewise. * include/tr1/hashtable (_Hashtable<>::max_size): Likewise. * testsuite/23_containers/vector/capacity/29134.cc: Add. * testsuite/23_containers/deque/capacity/29134.cc: Likewise. * testsuite/23_containers/list/capacity/29134.cc: Likewise. * testsuite/23_containers/set/capacity/29134.cc: Likewise. * testsuite/23_containers/map/capacity/29134.cc: Likewise. * testsuite/23_containers/multiset/capacity/29134.cc: Likewise. * testsuite/23_containers/multimap/capacity/29134.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-set.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-map.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-multiset.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-multimap.cc: Likewise. * include/bits/deque.tcc (deque<>::_M_new_elements_at_front, deque<>::_M_new_elements_at_back): Check for length errors. * testsuite/23_containers/deque/capacity/29134-2.cc: New. * testsuite/23_containers/vector/capacity/29134-2.cc: Likewise. * include/tr1/hashtable (_Hashtable<>::_M_get_Value_allocator): Add. (_Hashtable<>::_M_allocate_node, _M_deallocate_node): Use it. * testsuite/tr1/6_containers/unordered/instantiate/set.cc: Add test. * testsuite/tr1/6_containers/unordered/instantiate/map.cc: Likewise. * testsuite/tr1/6_containers/unordered/instantiate/multiset.cc: Likewise. * testsuite/tr1/6_containers/unordered/instantiate/multimap.cc: Likewise. From-SVN: r117099
2006-09-21 02:11:52 +02:00
if (this->max_size() - this->size() < __new_elems)
__throw_length_error(__N("deque::_M_new_elements_at_back"));
const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
/ _S_buffer_size());
_M_reserve_map_at_back(__new_nodes);
size_type __i;
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__try
{
for (__i = 1; __i <= __new_nodes; ++__i)
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
*(this->_M_impl._M_finish._M_node + __i) = this->_M_allocate_node();
}
re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/25191 * libsupc++/exception_defines.h: Depending on __EXCEPTIONS, deal consistently with __try and __catch too. * src/localename.cc: Replace try -> __try, catch -> __catch. * src/ios.cc: Likewise. * src/locale.cc: Likewise. * src/istream.cc: Likewise. * src/thread.cc: Likewise. * src/compatibility.cc: Likewise. * src/bitmap_allocator.cc: Likewise. * src/ios_init.cc: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/tr1_impl/hashtable: Likewise. * include/std/bitset: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_standard_resize_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ split_join_branch_bag.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/debug_map_base.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/slist: Likewise. * include/ext/memory: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/rope: Likewise. * include/ext/sso_string_base.h: Likewise. * include/bits/shared_ptr.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/locale_classes.tcc: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_classes.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/istream.tcc: Likewise. * include/bits/stl_uninitialized.h: Likewise. * include/bits/ostream.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_tempbuf.h: Likewise. * include/bits/deque.tcc: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/ostream_insert.h: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/fstream.tcc: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/backward/hashtable.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/eh_personality.cc: Likewise. * libsupc++/eh_call.cc: Likewise. * config/locale/gnu/monetary_members.cc: Likewise. * config/locale/gnu/time_members.h: Likewise. * config/locale/generic/time_members.h: Likewise. From-SVN: r143913
2009-02-04 00:44:53 +01:00
__catch(...)
{
for (size_type __j = 1; __j < __i; ++__j)
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
_M_deallocate_node(*(this->_M_impl._M_finish._M_node + __j));
__throw_exception_again;
}
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp, _Alloc>::
_M_reallocate_map(size_type __nodes_to_add, bool __add_at_front)
{
const size_type __old_num_nodes
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
= this->_M_impl._M_finish._M_node - this->_M_impl._M_start._M_node + 1;
const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
_Map_pointer __new_nstart;
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
if (this->_M_impl._M_map_size > 2 * __new_num_nodes)
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
__new_nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size
- __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
if (__new_nstart < this->_M_impl._M_start._M_node)
std::copy(this->_M_impl._M_start._M_node,
re PR libstdc++/29134 (Has there been a serious attempt to define the max_size() member functions?) 2006-09-20 Paolo Carlini <pcarlini@suse.de> PR libstdc++/29134 * include/bits/stl_list.h (list<>::max_size): Forward to allocator' max_size. * include/bits/stl_vector.h (vector<>::max_size): Likewise. * include/bits/stl_deque.h (deque<>::max_size): Likewise. * include/bits/stl_tree.h (_Rb_tree<>::max_size): Likewise. * include/tr1/hashtable (_Hashtable<>::max_size): Likewise. * testsuite/23_containers/vector/capacity/29134.cc: Add. * testsuite/23_containers/deque/capacity/29134.cc: Likewise. * testsuite/23_containers/list/capacity/29134.cc: Likewise. * testsuite/23_containers/set/capacity/29134.cc: Likewise. * testsuite/23_containers/map/capacity/29134.cc: Likewise. * testsuite/23_containers/multiset/capacity/29134.cc: Likewise. * testsuite/23_containers/multimap/capacity/29134.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-set.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-map.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-multiset.cc: Likewise. * testsuite/tr1/6_containers/unordered/capacity/29134-multimap.cc: Likewise. * include/bits/deque.tcc (deque<>::_M_new_elements_at_front, deque<>::_M_new_elements_at_back): Check for length errors. * testsuite/23_containers/deque/capacity/29134-2.cc: New. * testsuite/23_containers/vector/capacity/29134-2.cc: Likewise. * include/tr1/hashtable (_Hashtable<>::_M_get_Value_allocator): Add. (_Hashtable<>::_M_allocate_node, _M_deallocate_node): Use it. * testsuite/tr1/6_containers/unordered/instantiate/set.cc: Add test. * testsuite/tr1/6_containers/unordered/instantiate/map.cc: Likewise. * testsuite/tr1/6_containers/unordered/instantiate/multiset.cc: Likewise. * testsuite/tr1/6_containers/unordered/instantiate/multimap.cc: Likewise. From-SVN: r117099
2006-09-21 02:11:52 +02:00
this->_M_impl._M_finish._M_node + 1,
__new_nstart);
else
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
std::copy_backward(this->_M_impl._M_start._M_node,
this->_M_impl._M_finish._M_node + 1,
__new_nstart + __old_num_nodes);
}
else
{
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
size_type __new_map_size = this->_M_impl._M_map_size
+ std::max(this->_M_impl._M_map_size,
__nodes_to_add) + 2;
_Map_pointer __new_map = this->_M_allocate_map(__new_map_size);
__new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
std::copy(this->_M_impl._M_start._M_node,
this->_M_impl._M_finish._M_node + 1,
__new_nstart);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
_M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size);
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_map = __new_map;
this->_M_impl._M_map_size = __new_map_size;
}
stl_list.h: Created a _List_impl class and made it derive from the allocator... 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_list.h: Created a _List_impl class and made it derive from the allocator, instead of the list deriving from the allocator class, which was not conformant. Changed all references from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_deque.h: Created a _Deque_impl class and made it derive from the allocator, instead of the deque deriving from the allocator class, which was not conformant. Changed all references to the _M_start, _M_finish, _M_map, and _M_map_size to _M_impl.*. (_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this-> qualification in 2 places where it was missing. (_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as above. * include/bits/deque.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * include/bits/stl_vector.h: Created a _Vector_impl class and made it derive from the allocator, instead of the _Vector_base class, deriving from the allocator which was not conformant. Changed all references to the _M_start, _M_finish, and _M_end_of_storage to _M_impl.*. * include/bits/vector.tcc: Same as above (changed all references to the concerned variables). 2004-03-25 Dhruv Matani <dhruvbird@gmx.net> * testsuite/23_containers/deque/cons/clear_allocator.cc: New. * testsuite/23_containers/list/cons/clear_allocator.cc: New. * testsuite/23_containers/vector/cons/clear_allocator.cc: New. From-SVN: r79957
2004-03-25 18:12:16 +01:00
this->_M_impl._M_start._M_set_node(__new_nstart);
this->_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
}
c++config: Add in revised namespace associations. 2005-12-18 Benjamin Kosnik <bkoz@redhat.com> * include/bits/c++config: Add in revised namespace associations. _GLIBCXX_BEGIN_NAMESPACE: New macro. _GLIBCXX_END_NAMESPACE: Same. _GLIBCXX_BEGIN_NESTED_NAMESPACE: Same. _GLIBCXX_END_NESTED_NAMESPACE: Same. * acinclude.m4 (GLIBCXX_ENABLE_SYMVERS]): Add gnu-versioned-namespace. * configure: Regenerated. * config.h.in: Same. * config/abi/pre/gnu-versioned-namespace.ver: New. * config/abi/pre/gnu.ver (GLIBCXX_3.4.7): Add exports for nested debug mode items. * include/Makefile.am (${host_builddir}/c++config.h): Fill in values for __GLIBCXX__ and _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION. * include/Makefile.in: Regnerate. * src/compatibility.cc: Alias new, nested definitions to exported symbols from non-nested __gnu_debug. * src/Makefile.am: Add in ENABLE_SYMVERS_GNU_NAMESPACE. * src/Makefile.in: Regenerate. * docs/html/debug_mode.html: Revise for nested design. * docs/html/debug.html: Use debug qualifications instead of __gnu_debug. * docs/html/configopts.html: Revise documentation for --enable-symvers. * include/debug/formatter: Simplify namespace qualifications for current, nested-only reality. Add top-level namespace alias, namespace debug, for debug-mode containers. * include/debug/safe_iterator.h: Same. * include/debug/set.h: Same. * include/debug/hash_multimap.h: Same. * include/debug/hash_set.h: Same. * include/debug/bitset * include/debug/safe_sequence.h: Same. * include/debug/multiset.h: Same. * include/debug/safe_base.h: Same. * include/debug/functions.h: Same. * include/debug/safe_iterator.tcc * include/debug/hash_multiset.h: Same. * include/debug/vector * include/debug/map.h: Same. * include/debug/deque * include/debug/hash_map.h: Same. * include/debug/string * include/debug/macros.h: Same. * include/debug/list * include/debug/debug.h: Same. * include/debug/multimap.h: Same. * src/debug.cc: Same. * testsuite/23_containers/vector/invalidation/1.cc: Cleanups. * testsuite/23_containers/vector/invalidation/2.cc: Same. * testsuite/23_containers/vector/invalidation/3.cc: Same. * testsuite/23_containers/vector/invalidation/4.cc: Same. * testsuite/23_containers/deque/invalidation/1.cc: Same. * testsuite/23_containers/deque/invalidation/2.cc: Same. * testsuite/23_containers/deque/invalidation/3.cc: Same. * testsuite/23_containers/deque/invalidation/4.cc: Same. * testsuite/23_containers/multiset/invalidation/1.cc: Same. * testsuite/23_containers/multiset/invalidation/2.cc: Same. * testsuite/23_containers/multimap/invalidation/1.cc: Same. * testsuite/23_containers/multimap/invalidation/2.cc: Same. * testsuite/23_containers/bitset/invalidation/1.cc: Same. * testsuite/23_containers/bitset/cons/16020.cc: Same. * testsuite/23_containers/bitset/operations/13838.cc: Same. * testsuite/23_containers/list/invalidation/1.cc: Same. * testsuite/23_containers/list/invalidation/2.cc: Same. * testsuite/23_containers/list/invalidation/3.cc: Same. * testsuite/23_containers/list/invalidation/4.cc: Same. * testsuite/23_containers/set/invalidation/1.cc: Same. * testsuite/23_containers/set/invalidation/2.cc: Same. * testsuite/23_containers/map/invalidation/1.cc: Same. * testsuite/23_containers/map/invalidation/2.cc: Same. * testsuite/23_containers/map/insert/16813.cc: Same. * include/bits/basic_ios.h: Use _GLIBCXX_BEGIN_NAMESPACE(std) and friends. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_algobase.h: Same. * include/bits/localefwd.h: Same. * include/bits/valarray_array.tcc: Same. * include/bits/valarray_after.h: Same. * include/bits/gslice_array.h: Same. * include/bits/stl_queue.h: Same. * include/bits/gslice.h: Same. * include/bits/locale_facets.tcc: Same. * include/bits/locale_classes.h: Same. * include/bits/stl_set.h: Same. * include/bits/locale_facets.h: Same. * include/bits/stl_stack.h: Same. * include/bits/stl_iterator_base_types.h: Same. * include/bits/stl_heap.h: Same. * include/bits/indirect_array.h: Same. * include/bits/atomicity.h: Same. * include/bits/stream_iterator.h: Same. * include/bits/concurrence.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_pair.h: Same. * include/bits/basic_ios.tcc: Same. * include/bits/stl_raw_storage_iter.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_numeric.h: Same. * include/bits/ios_base.h: Same. * include/bits/stl_deque.h: Same. * include/bits/istream.tcc: Same. * include/bits/postypes.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/mask_array.h: Same. * include/bits/stl_uninitialized.h: Same. * include/bits/ostream.tcc: Same. * include/bits/slice_array.h: Same. * include/bits/boost_concept_check.h: Same. * include/bits/sstream.tcc: Same. * include/bits/stl_iterator_base_funcs.h: Same. * include/bits/char_traits.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stringfwd.h: Same. * include/bits/c++config * include/bits/stl_iterator.h: Same. * include/bits/valarray_array.h: Same. * include/bits/stl_tempbuf.h: Same. * include/bits/vector.tcc: Same. * include/bits/deque.tcc: Same. * include/bits/stl_bvector.h: Same. * include/bits/basic_string.tcc: Same. * include/bits/list.tcc: Same. * include/bits/streambuf_iterator.h: Same. * include/bits/valarray_before.h: Same. * include/bits/stl_construct.h: Same. * include/bits/stl_function.h: Same. * include/bits/cpp_type_traits.h: Same. * include/bits/streambuf.tcc: Same. * include/bits/allocator.h: Same. * include/bits/stl_tree.h: Same. * include/bits/fstream.tcc: Same. * include/bits/stl_relops.h: Same. * include/bits/functexcept.h: Same. * include/std/std_valarray.h: Same. * include/std/std_iostream.h: Same. * include/std/std_streambuf.h: Same. * include/std/std_bitset.h: Same. * include/std/std_iosfwd.h: Same. * include/std/std_iomanip.h: Same. * include/std/std_fstream.h: Same. * include/std/std_limits.h: Same. * include/std/std_stdexcept.h: Same. * include/std/std_istream.h: Same. * include/std/std_complex.h: Same. * include/std/std_memory.h: Same. * include/std/std_ostream.h: Same. * include/std/std_sstream.h: Same. * include/c_std/std_csignal.h: Same. * include/c_std/std_cstdlib.h: Same. * include/c_std/std_cstdio.h: Same. * include/c_std/std_cstdarg.h: Same. * include/c_std/std_cctype.h: Same. * include/c_std/std_cmath.h: Same. * include/c_std/std_ctime.h: Same. * include/c_std/std_clocale.h: Same. * include/c_std/std_csetjmp.h: Same. * include/c_std/std_cwchar.h: Same. * include/c_std/std_cstring.h: Same. * include/c_std/std_cstddef.h: Same. * include/c_std/std_cwctype.h: Same. * include/backward/iterator.h: Same. * include/backward/set.h: Same. * include/backward/hashtable.h: Same. * include/backward/fstream.h: Same. * include/backward/tempbuf.h: Same. * include/backward/istream.h: Same. * include/backward/bvector.h: Same. * include/backward/stack.h: Same. * include/backward/rope.h: Same. * include/backward/complex.h: Same. * include/backward/ostream.h: Same. * include/backward/heap.h: Same. * include/backward/iostream.h: Same. * include/backward/function.h: Same. * include/backward/multimap.h: Same. * include/backward/pair.h: Same. * include/backward/stream.h: Same. * include/backward/iomanip.h: Same. * include/backward/strstream * include/backward/slist.h: Same. * include/backward/tree.h: Same. * include/backward/vector.h: Same. * include/backward/deque.h: Same. * include/backward/multiset.h: Same. * include/backward/list.h: Same. * include/backward/map.h: Same. * include/backward/algobase.h: Same. * include/backward/hash_map.h: Same. * include/backward/algo.h: Same. * include/backward/queue.h: Same. * include/backward/streambuf.h: Same. * src/allocator-inst.cc: Same. * src/complex_io.cc: Same. * src/localename.cc: Same. * src/limits.cc: Same. * src/ios_failure.cc: Same. * src/locale-misc-inst.cc: Same. * src/streambuf-inst.cc: Same. * src/misc-inst.cc: Same. * src/concept-inst.cc: Same. * src/ios_locale.cc: Same. * src/pool_allocator.cc: Same. * src/fstream-inst.cc: Same. * src/istream-inst.cc: Same. * src/string-inst.cc: Same. * src/locale_init.cc: Same. * src/ctype.cc: Same. * src/strstream.cc: Same. * src/ostream-inst.cc: Same. * src/functexcept.cc: Same. * src/streambuf.cc: Same. * src/sstream-inst.cc: Same. * src/ios.cc: Same. * src/valarray-inst.cc: Same. * src/locale.cc: Same. * src/tree.cc: Same. * src/stdexcept.cc: Same. * src/istream.cc: Same. * src/compatibility.cc: Same. * src/locale-inst.cc: Same. * src/globals_io.cc: Same. * src/list.cc: Same. * src/ios_init.cc: Same. * src/locale_facets.cc: Same. * src/codecvt.cc: Same. * include/tr1/unordered_map: Use _GLIBCXX_BEGIN_NAMESPACE(tr1). * include/tr1/boost_shared_ptr.h: Same. * include/tr1/tuple * include/tr1/hashtable * include/tr1/type_traits_fwd.h: Same. * include/tr1/unordered_set * include/tr1/functional * include/tr1/ref_fwd.h: Same. * include/tr1/utility * include/tr1/type_traits * include/tr1/array * include/ext/hashtable.h: Use _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx). * include/ext/typelist.h: Same. * include/ext/hash_map: Same. * include/ext/rc_string_base.h: Same. * include/ext/pool_allocator.h: Same. * include/ext/iterator: Same. * include/ext/rb_tree: Same. * include/ext/numeric: Same. * include/ext/vstring.tcc: Same. * include/ext/sso_string_base.h: Same. * include/ext/stdio_filebuf.h: Same. * include/ext/algorithm: Same. * include/ext/codecvt_specializations.h: Same. * include/ext/new_allocator.h: Same. * include/ext/array_allocator.h: Same. * include/ext/vstring_util.h: Same. * include/ext/vstring_fwd.h: Same. * include/ext/mt_allocator.h: Same. * include/ext/debug_allocator.h: Same. * include/ext/slist: Same. * include/ext/stdio_sync_filebuf.h: Same. * include/ext/hash_fun.h: Same. * include/ext/malloc_allocator.h: Same. * include/ext/functional: Same. * include/ext/bitmap_allocator.h: Same. * include/ext/pod_char_traits.h: Same. * include/ext/vstring.h: Same. * include/ext/ropeimpl.h: Same. * include/ext/hash_set: Same. * include/ext/memory: Same. * include/ext/rope: Same. * include/bits/boost_concept_check.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/char_traits.h: Same. * include/bits/cpp_type_traits.h: Same. * include/bits/concurrence.h: Same. * include/bits/atomicity.h: Same. * config/locale/gnu/numeric_members.cc: Same. * config/locale/gnu/collate_members.cc: Same. * config/locale/gnu/ctype_members.cc: Same. * config/locale/gnu/c_locale.cc: Same. * config/locale/gnu/codecvt_members.cc: Same. * config/locale/gnu/messages_members.cc: Same. * config/locale/gnu/c_locale.h: Same. * config/locale/gnu/monetary_members.cc: Same. * config/locale/gnu/time_members.cc: Same. * config/locale/ieee_1003.1-2001/c_locale.h: Same. * config/locale/generic/numeric_members.cc: Same. * config/locale/generic/collate_members.cc: Same. * config/locale/generic/ctype_members.cc: Same. * config/locale/generic/c_locale.cc: Same. * config/locale/generic/codecvt_members.cc: Same. * config/locale/generic/messages_members.cc: Same. * config/locale/generic/c_locale.h: Same. * config/locale/generic/monetary_members.cc: Same. * config/locale/generic/time_members.cc: Same. * config/os/aix/atomicity.h: Same. * config/os/irix/atomicity.h: Same. * config/cpu/powerpc/atomicity.h: Same. * config/cpu/cris/atomicity.h: Same. * config/cpu/ia64/atomicity.h: Same. * config/cpu/alpha/atomicity.h: Same. * config/cpu/m68k/atomicity.h: Same. * config/cpu/hppa/atomicity.h: Same. * config/cpu/mips/atomicity.h: Same. * config/cpu/sparc/atomicity.h: Same. * config/cpu/i386/atomicity.h: Same. * config/cpu/i486/atomicity.h: Same. * config/cpu/sh/atomicity.h: Same. * config/cpu/generic/atomicity.h: Same. * config/cpu/s390/atomicity.h: Same. * config/io/c_io_stdio.h: Same. * config/io/basic_file_stdio.cc: Same. * config/io/basic_file_stdio.h: Same. * src/misc-inst.cc: Same. * src/concept-inst.cc: Same. * src/ext-inst.cc: Same. * src/string-inst.cc: Same. * src/pool_allocator.cc: Same. * src/bitmap_allocator.cc: Same. * src/mt_allocator.cc: Same. * libsupc++/exception: Same. * libsupc++/vterminate.cc: Same. * testsuite/ext/hash_map/1.cc: Explicitly qualify __gnu_cxx::hash_map. * testsuite/ext/hash_map/14648.cc: Same. * libsupc++/eh_alloc.cc: Correct comment line spacing. From-SVN: r108775
2005-12-19 01:56:05 +01:00
// Overload for deque::iterators, exploiting the "segmented-iterator
// optimization".
template<typename _Tp>
void
fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>& __first,
const _Deque_iterator<_Tp, _Tp&, _Tp*>& __last, const _Tp& __value)
{
typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
for (typename _Self::_Map_pointer __node = __first._M_node + 1;
__node < __last._M_node; ++__node)
std::fill(*__node, *__node + _Self::_S_buffer_size(), __value);
if (__first._M_node != __last._M_node)
{
std::fill(__first._M_cur, __first._M_last, __value);
std::fill(__last._M_first, __last._M_cur, __value);
}
else
std::fill(__first._M_cur, __last._M_cur, __value);
}
template<typename _Tp>
_Deque_iterator<_Tp, _Tp&, _Tp*>
copy(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first,
_Deque_iterator<_Tp, const _Tp&, const _Tp*> __last,
_Deque_iterator<_Tp, _Tp&, _Tp*> __result)
{
typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
typedef typename _Self::difference_type difference_type;
difference_type __len = __last - __first;
while (__len > 0)
{
const difference_type __clen
= std::min(__len, std::min(__first._M_last - __first._M_cur,
__result._M_last - __result._M_cur));
std::copy(__first._M_cur, __first._M_cur + __clen, __result._M_cur);
__first += __clen;
__result += __clen;
__len -= __clen;
}
return __result;
}
template<typename _Tp>
_Deque_iterator<_Tp, _Tp&, _Tp*>
copy_backward(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first,
_Deque_iterator<_Tp, const _Tp&, const _Tp*> __last,
_Deque_iterator<_Tp, _Tp&, _Tp*> __result)
{
typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
typedef typename _Self::difference_type difference_type;
difference_type __len = __last - __first;
while (__len > 0)
{
difference_type __llen = __last._M_cur - __last._M_first;
_Tp* __lend = __last._M_cur;
difference_type __rlen = __result._M_cur - __result._M_first;
_Tp* __rend = __result._M_cur;
if (!__llen)
{
__llen = _Self::_S_buffer_size();
__lend = *(__last._M_node - 1) + __llen;
}
if (!__rlen)
{
__rlen = _Self::_S_buffer_size();
__rend = *(__result._M_node - 1) + __rlen;
}
const difference_type __clen = std::min(__len,
std::min(__llen, __rlen));
std::copy_backward(__lend - __clen, __lend, __rend);
__last -= __clen;
__result -= __clen;
__len -= __clen;
}
return __result;
}
#if __cplusplus >= 201103L
template<typename _Tp>
_Deque_iterator<_Tp, _Tp&, _Tp*>
move(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first,
_Deque_iterator<_Tp, const _Tp&, const _Tp*> __last,
_Deque_iterator<_Tp, _Tp&, _Tp*> __result)
{
typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
typedef typename _Self::difference_type difference_type;
difference_type __len = __last - __first;
while (__len > 0)
{
const difference_type __clen
= std::min(__len, std::min(__first._M_last - __first._M_cur,
__result._M_last - __result._M_cur));
std::move(__first._M_cur, __first._M_cur + __clen, __result._M_cur);
__first += __clen;
__result += __clen;
__len -= __clen;
}
return __result;
}
template<typename _Tp>
_Deque_iterator<_Tp, _Tp&, _Tp*>
move_backward(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first,
_Deque_iterator<_Tp, const _Tp&, const _Tp*> __last,
_Deque_iterator<_Tp, _Tp&, _Tp*> __result)
{
typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self;
typedef typename _Self::difference_type difference_type;
difference_type __len = __last - __first;
while (__len > 0)
{
difference_type __llen = __last._M_cur - __last._M_first;
_Tp* __lend = __last._M_cur;
difference_type __rlen = __result._M_cur - __result._M_first;
_Tp* __rend = __result._M_cur;
if (!__llen)
{
__llen = _Self::_S_buffer_size();
__lend = *(__last._M_node - 1) + __llen;
}
if (!__rlen)
{
__rlen = _Self::_S_buffer_size();
__rend = *(__result._M_node - 1) + __rlen;
}
const difference_type __clen = std::min(__len,
std::min(__llen, __rlen));
std::move_backward(__lend - __clen, __lend, __rend);
__last -= __clen;
__result -= __clen;
__len -= __clen;
}
return __result;
}
#endif
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
#endif