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

782 lines
23 KiB
Plaintext
Raw Normal View History

// Vector implementation (out of line) -*- C++ -*-
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
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
// 2011 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) 1996
* 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/vector.tcc
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{vector}
*/
#ifndef _VECTOR_TCC
#define _VECTOR_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
template<typename _Tp, typename _Alloc>
void
vector<_Tp, _Alloc>::
reserve(size_type __n)
{
if (__n > this->max_size())
__throw_length_error(__N("vector::reserve"));
if (this->capacity() < __n)
{
const size_type __old_size = size();
pointer __tmp = _M_allocate_and_copy(__n,
_GLIBCXX_MAKE_MOVE_ITERATOR(this->_M_impl._M_start),
_GLIBCXX_MAKE_MOVE_ITERATOR(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
std::_Destroy(this->_M_impl._M_start, 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
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
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 = __tmp;
this->_M_impl._M_finish = __tmp + __old_size;
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
}
}
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
#ifdef __GXX_EXPERIMENTAL_CXX0X__
template<typename _Tp, typename _Alloc>
template<typename... _Args>
void
vector<_Tp, _Alloc>::
emplace_back(_Args&&... __args)
{
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
{
this->_M_impl.construct(this->_M_impl._M_finish,
std::forward<_Args>(__args)...);
++this->_M_impl._M_finish;
}
else
_M_insert_aux(end(), std::forward<_Args>(__args)...);
}
#endif
template<typename _Tp, typename _Alloc>
typename vector<_Tp, _Alloc>::iterator
vector<_Tp, _Alloc>::
insert(iterator __position, const value_type& __x)
{
const size_type __n = __position - begin();
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
&& __position == end())
{
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.construct(this->_M_impl._M_finish, __x);
++this->_M_impl._M_finish;
}
else
{
#ifdef __GXX_EXPERIMENTAL_CXX0X__
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
{
_Tp __x_copy = __x;
_M_insert_aux(__position, std::move(__x_copy));
}
else
#endif
_M_insert_aux(__position, __x);
}
return iterator(this->_M_impl._M_start + __n);
}
template<typename _Tp, typename _Alloc>
typename vector<_Tp, _Alloc>::iterator
vector<_Tp, _Alloc>::
erase(iterator __position)
{
if (__position + 1 != end())
_GLIBCXX_MOVE3(__position + 1, end(), __position);
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.destroy(this->_M_impl._M_finish);
return __position;
}
template<typename _Tp, typename _Alloc>
typename vector<_Tp, _Alloc>::iterator
vector<_Tp, _Alloc>::
erase(iterator __first, iterator __last)
{
if (__last != end())
_GLIBCXX_MOVE3(__last, end(), __first);
_M_erase_at_end(__first.base() + (end() - __last));
return __first;
}
template<typename _Tp, typename _Alloc>
vector<_Tp, _Alloc>&
vector<_Tp, _Alloc>::
operator=(const vector<_Tp, _Alloc>& __x)
{
if (&__x != this)
{
const size_type __xlen = __x.size();
if (__xlen > capacity())
{
pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(),
__x.end());
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, 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());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __tmp;
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen;
}
else if (size() >= __xlen)
{
std::_Destroy(std::copy(__x.begin(), __x.end(), begin()),
end(), _M_get_Tp_allocator());
}
else
{
std::copy(__x._M_impl._M_start, __x._M_impl._M_start + size(),
this->_M_impl._M_start);
std::__uninitialized_copy_a(__x._M_impl._M_start + size(),
__x._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());
}
this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
}
return *this;
}
template<typename _Tp, typename _Alloc>
void
vector<_Tp, _Alloc>::
_M_fill_assign(size_t __n, const value_type& __val)
{
if (__n > capacity())
{
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
vector __tmp(__n, __val, _M_get_Tp_allocator());
__tmp.swap(*this);
}
else if (__n > size())
{
std::fill(begin(), end(), __val);
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_n_a(this->_M_impl._M_finish,
__n - size(), __val,
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());
this->_M_impl._M_finish += __n - size();
}
else
_M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val));
}
template<typename _Tp, typename _Alloc>
template<typename _InputIterator>
void
vector<_Tp, _Alloc>::
_M_assign_aux(_InputIterator __first, _InputIterator __last,
std::input_iterator_tag)
{
pointer __cur(this->_M_impl._M_start);
for (; __first != __last && __cur != this->_M_impl._M_finish;
++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
_M_erase_at_end(__cur);
else
insert(end(), __first, __last);
}
template<typename _Tp, typename _Alloc>
template<typename _ForwardIterator>
void
vector<_Tp, _Alloc>::
_M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
std::forward_iterator_tag)
{
const size_type __len = std::distance(__first, __last);
if (__len > capacity())
{
pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
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, 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());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __tmp;
this->_M_impl._M_finish = this->_M_impl._M_start + __len;
this->_M_impl._M_end_of_storage = this->_M_impl._M_finish;
}
else if (size() >= __len)
_M_erase_at_end(std::copy(__first, __last, this->_M_impl._M_start));
else
{
_ForwardIterator __mid = __first;
std::advance(__mid, size());
std::copy(__first, __mid, 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
this->_M_impl._M_finish =
std::__uninitialized_copy_a(__mid, __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());
}
}
#ifdef __GXX_EXPERIMENTAL_CXX0X__
template<typename _Tp, typename _Alloc>
template<typename... _Args>
typename vector<_Tp, _Alloc>::iterator
vector<_Tp, _Alloc>::
emplace(iterator __position, _Args&&... __args)
{
const size_type __n = __position - begin();
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
&& __position == end())
{
this->_M_impl.construct(this->_M_impl._M_finish,
std::forward<_Args>(__args)...);
++this->_M_impl._M_finish;
}
else
_M_insert_aux(__position, std::forward<_Args>(__args)...);
return iterator(this->_M_impl._M_start + __n);
}
template<typename _Tp, typename _Alloc>
template<typename... _Args>
void
vector<_Tp, _Alloc>::
_M_insert_aux(iterator __position, _Args&&... __args)
#else
template<typename _Tp, typename _Alloc>
void
vector<_Tp, _Alloc>::
_M_insert_aux(iterator __position, const _Tp& __x)
#endif
{
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_finish != this->_M_impl._M_end_of_storage)
{
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.construct(this->_M_impl._M_finish,
_GLIBCXX_MOVE(*(this->_M_impl._M_finish
- 1)));
++this->_M_impl._M_finish;
#ifndef __GXX_EXPERIMENTAL_CXX0X__
_Tp __x_copy = __x;
#endif
_GLIBCXX_MOVE_BACKWARD3(__position.base(),
this->_M_impl._M_finish - 2,
this->_M_impl._M_finish - 1);
#ifndef __GXX_EXPERIMENTAL_CXX0X__
*__position = __x_copy;
#else
*__position = _Tp(std::forward<_Args>(__args)...);
#endif
}
else
{
const size_type __len =
_M_check_len(size_type(1), "vector::_M_insert_aux");
const size_type __elems_before = __position - begin();
pointer __new_start(this->_M_allocate(__len));
pointer __new_finish(__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
__try
{
// The order of the three operations is dictated by the C++0x
// case, where the moves could alter a new element belonging
// to the existing vector. This is an issue only for callers
// taking the element by const lvalue ref (see 23.1/13).
this->_M_impl.construct(__new_start + __elems_before,
#ifdef __GXX_EXPERIMENTAL_CXX0X__
std::forward<_Args>(__args)...);
#else
__x);
#endif
__new_finish = 0;
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_finish =
std::__uninitialized_move_a(this->_M_impl._M_start,
__position.base(), __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());
++__new_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
__new_finish =
std::__uninitialized_move_a(__position.base(),
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
__new_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());
}
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(...)
{
if (!__new_finish)
this->_M_impl.destroy(__new_start + __elems_before);
else
std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator());
_M_deallocate(__new_start, __len);
__throw_exception_again;
}
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __new_start;
this->_M_impl._M_finish = __new_finish;
this->_M_impl._M_end_of_storage = __new_start + __len;
}
}
template<typename _Tp, typename _Alloc>
void
vector<_Tp, _Alloc>::
_M_fill_insert(iterator __position, size_type __n, const value_type& __x)
{
if (__n != 0)
{
if (size_type(this->_M_impl._M_end_of_storage
- this->_M_impl._M_finish) >= __n)
{
value_type __x_copy = __x;
const size_type __elems_after = end() - __position;
pointer __old_finish(this->_M_impl._M_finish);
if (__elems_after > __n)
{
std::__uninitialized_move_a(this->_M_impl._M_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());
this->_M_impl._M_finish += __n;
_GLIBCXX_MOVE_BACKWARD3(__position.base(),
__old_finish - __n, __old_finish);
std::fill(__position.base(), __position.base() + __n,
__x_copy);
}
else
{
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_n_a(this->_M_impl._M_finish,
__n - __elems_after,
__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());
this->_M_impl._M_finish += __n - __elems_after;
std::__uninitialized_move_a(__position.base(), __old_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());
this->_M_impl._M_finish += __elems_after;
std::fill(__position.base(), __old_finish, __x_copy);
}
}
else
{
const size_type __len =
_M_check_len(__n, "vector::_M_fill_insert");
const size_type __elems_before = __position - begin();
pointer __new_start(this->_M_allocate(__len));
pointer __new_finish(__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
__try
{
// See _M_insert_aux above.
std::__uninitialized_fill_n_a(__new_start + __elems_before,
__n, __x,
_M_get_Tp_allocator());
__new_finish = 0;
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_finish =
std::__uninitialized_move_a(this->_M_impl._M_start,
__position.base(),
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());
__new_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
__new_finish =
std::__uninitialized_move_a(__position.base(),
this->_M_impl._M_finish,
__new_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());
}
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(...)
{
if (!__new_finish)
std::_Destroy(__new_start + __elems_before,
__new_start + __elems_before + __n,
_M_get_Tp_allocator());
else
std::_Destroy(__new_start, __new_finish,
_M_get_Tp_allocator());
_M_deallocate(__new_start, __len);
__throw_exception_again;
}
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, 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());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __new_start;
this->_M_impl._M_finish = __new_finish;
this->_M_impl._M_end_of_storage = __new_start + __len;
}
}
}
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
#ifdef __GXX_EXPERIMENTAL_CXX0X__
template<typename _Tp, typename _Alloc>
void
vector<_Tp, _Alloc>::
_M_default_append(size_type __n)
{
if (__n != 0)
{
if (size_type(this->_M_impl._M_end_of_storage
- this->_M_impl._M_finish) >= __n)
{
std::__uninitialized_default_n_a(this->_M_impl._M_finish,
__n, _M_get_Tp_allocator());
this->_M_impl._M_finish += __n;
}
else
{
const size_type __len =
_M_check_len(__n, "vector::_M_default_append");
const size_type __old_size = this->size();
pointer __new_start(this->_M_allocate(__len));
pointer __new_finish(__new_start);
__try
{
__new_finish =
std::__uninitialized_move_a(this->_M_impl._M_start,
this->_M_impl._M_finish,
__new_start,
_M_get_Tp_allocator());
std::__uninitialized_default_n_a(__new_finish, __n,
_M_get_Tp_allocator());
__new_finish += __n;
}
__catch(...)
{
std::_Destroy(__new_start, __new_finish,
_M_get_Tp_allocator());
_M_deallocate(__new_start, __len);
__throw_exception_again;
}
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __new_start;
this->_M_impl._M_finish = __new_finish;
this->_M_impl._M_end_of_storage = __new_start + __len;
}
}
}
#endif
template<typename _Tp, typename _Alloc>
template<typename _InputIterator>
void
vector<_Tp, _Alloc>::
_M_range_insert(iterator __pos, _InputIterator __first,
_InputIterator __last, std::input_iterator_tag)
{
for (; __first != __last; ++__first)
{
__pos = insert(__pos, *__first);
++__pos;
}
}
template<typename _Tp, typename _Alloc>
template<typename _ForwardIterator>
void
vector<_Tp, _Alloc>::
_M_range_insert(iterator __position, _ForwardIterator __first,
_ForwardIterator __last, std::forward_iterator_tag)
{
if (__first != __last)
{
const size_type __n = std::distance(__first, __last);
if (size_type(this->_M_impl._M_end_of_storage
- this->_M_impl._M_finish) >= __n)
{
const size_type __elems_after = end() - __position;
pointer __old_finish(this->_M_impl._M_finish);
if (__elems_after > __n)
{
std::__uninitialized_move_a(this->_M_impl._M_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());
this->_M_impl._M_finish += __n;
_GLIBCXX_MOVE_BACKWARD3(__position.base(),
__old_finish - __n, __old_finish);
std::copy(__first, __last, __position);
}
else
{
_ForwardIterator __mid = __first;
std::advance(__mid, __elems_after);
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(__mid, __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());
this->_M_impl._M_finish += __n - __elems_after;
std::__uninitialized_move_a(__position.base(),
__old_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());
this->_M_impl._M_finish += __elems_after;
std::copy(__first, __mid, __position);
}
}
else
{
const size_type __len =
_M_check_len(__n, "vector::_M_range_insert");
pointer __new_start(this->_M_allocate(__len));
pointer __new_finish(__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
__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
__new_finish =
std::__uninitialized_move_a(this->_M_impl._M_start,
__position.base(),
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_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_finish =
std::__uninitialized_copy_a(__first, __last,
__new_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_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_finish =
std::__uninitialized_move_a(__position.base(),
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
__new_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());
}
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(__new_start, __new_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());
_M_deallocate(__new_start, __len);
__throw_exception_again;
}
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, 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());
_M_deallocate(this->_M_impl._M_start,
this->_M_impl._M_end_of_storage
- this->_M_impl._M_start);
this->_M_impl._M_start = __new_start;
this->_M_impl._M_finish = __new_finish;
this->_M_impl._M_end_of_storage = __new_start + __len;
}
}
}
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
// vector<bool>
template<typename _Alloc>
void
vector<bool, _Alloc>::
reserve(size_type __n)
{
if (__n > this->max_size())
__throw_length_error(__N("vector::reserve"));
if (this->capacity() < __n)
{
_Bit_type* __q = this->_M_allocate(__n);
this->_M_impl._M_finish = _M_copy_aligned(begin(), end(),
iterator(__q, 0));
this->_M_deallocate();
this->_M_impl._M_start = iterator(__q, 0);
this->_M_impl._M_end_of_storage = (__q + (__n + int(_S_word_bit) - 1)
/ int(_S_word_bit));
}
}
template<typename _Alloc>
void
vector<bool, _Alloc>::
_M_fill_insert(iterator __position, size_type __n, bool __x)
{
if (__n == 0)
return;
if (capacity() - size() >= __n)
{
std::copy_backward(__position, end(),
this->_M_impl._M_finish + difference_type(__n));
std::fill(__position, __position + difference_type(__n), __x);
this->_M_impl._M_finish += difference_type(__n);
}
else
{
const size_type __len =
_M_check_len(__n, "vector<bool>::_M_fill_insert");
_Bit_type * __q = this->_M_allocate(__len);
iterator __i = _M_copy_aligned(begin(), __position,
iterator(__q, 0));
std::fill(__i, __i + difference_type(__n), __x);
this->_M_impl._M_finish = std::copy(__position, end(),
__i + difference_type(__n));
this->_M_deallocate();
this->_M_impl._M_end_of_storage = (__q + ((__len
+ int(_S_word_bit) - 1)
/ int(_S_word_bit)));
this->_M_impl._M_start = iterator(__q, 0);
}
}
template<typename _Alloc>
template<typename _ForwardIterator>
void
vector<bool, _Alloc>::
_M_insert_range(iterator __position, _ForwardIterator __first,
_ForwardIterator __last, std::forward_iterator_tag)
{
if (__first != __last)
{
size_type __n = std::distance(__first, __last);
if (capacity() - size() >= __n)
{
std::copy_backward(__position, end(),
this->_M_impl._M_finish
+ difference_type(__n));
std::copy(__first, __last, __position);
this->_M_impl._M_finish += difference_type(__n);
}
else
{
const size_type __len =
_M_check_len(__n, "vector<bool>::_M_insert_range");
_Bit_type * __q = this->_M_allocate(__len);
iterator __i = _M_copy_aligned(begin(), __position,
iterator(__q, 0));
__i = std::copy(__first, __last, __i);
this->_M_impl._M_finish = std::copy(__position, end(), __i);
this->_M_deallocate();
this->_M_impl._M_end_of_storage = (__q
+ ((__len
+ int(_S_word_bit) - 1)
/ int(_S_word_bit)));
this->_M_impl._M_start = iterator(__q, 0);
}
}
}
template<typename _Alloc>
void
vector<bool, _Alloc>::
_M_insert_aux(iterator __position, bool __x)
{
if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage)
{
std::copy_backward(__position, this->_M_impl._M_finish,
this->_M_impl._M_finish + 1);
*__position = __x;
++this->_M_impl._M_finish;
}
else
{
const size_type __len =
_M_check_len(size_type(1), "vector<bool>::_M_insert_aux");
_Bit_type * __q = this->_M_allocate(__len);
iterator __i = _M_copy_aligned(begin(), __position,
iterator(__q, 0));
*__i++ = __x;
this->_M_impl._M_finish = std::copy(__position, end(), __i);
this->_M_deallocate();
this->_M_impl._M_end_of_storage = (__q + ((__len
+ int(_S_word_bit) - 1)
/ int(_S_word_bit)));
this->_M_impl._M_start = iterator(__q, 0);
}
}
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
#ifdef __GXX_EXPERIMENTAL_CXX0X__
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_VERSION
template<typename _Alloc>
size_t
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
hash<_GLIBCXX_STD_C::vector<bool, _Alloc>>::
operator()(const _GLIBCXX_STD_C::vector<bool, _Alloc>& __b) const
{
size_t __hash = 0;
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
using _GLIBCXX_STD_C::_S_word_bit;
using _GLIBCXX_STD_C::_Bit_type;
const size_t __words = __b.size() / _S_word_bit;
if (__words)
{
const size_t __clength = __words * sizeof(_Bit_type);
__hash = std::_Hash_impl::hash(__b._M_impl._M_start._M_p, __clength);
}
const size_t __extrabits = __b.size() % _S_word_bit;
if (__extrabits)
{
_Bit_type __hiword = *__b._M_impl._M_finish._M_p;
__hiword &= ~((~static_cast<_Bit_type>(0)) << __extrabits);
const size_t __clength
= (__extrabits + __CHAR_BIT__ - 1) / __CHAR_BIT__;
if (__words)
__hash = std::_Hash_impl::hash(&__hiword, __clength, __hash);
else
__hash = std::_Hash_impl::hash(&__hiword, __clength);
}
return __hash;
}
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_VERSION
} // namespace std
#endif // __GXX_EXPERIMENTAL_CXX0X__
#endif /* _VECTOR_TCC */