gcc/libstdc++-v3/include/profile/vector

545 lines
15 KiB
Plaintext
Raw Normal View History

// Profiling vector implementation -*- C++ -*-
// Copyright (C) 2009-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/vector
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_VECTOR
#define _GLIBCXX_PROFILE_VECTOR 1
#include <vector>
#include <utility>
#include <profile/base.h>
#include <profile/iterator_tracker.h>
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)
{
namespace __profile
{
template<typename _Tp,
typename _Allocator = std::allocator<_Tp> >
class vector
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
: public _GLIBCXX_STD_C::vector<_Tp, _Allocator>
{
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
typedef _GLIBCXX_STD_C::vector<_Tp, _Allocator> _Base;
#if __cplusplus >= 201103L
typedef __gnu_cxx::__alloc_traits<_Allocator> _Alloc_traits;
#endif
public:
typedef typename _Base::reference reference;
typedef typename _Base::const_reference const_reference;
typedef __iterator_tracker<typename _Base::iterator, vector>
iterator;
typedef __iterator_tracker<typename _Base::const_iterator, vector>
const_iterator;
typedef typename _Base::size_type size_type;
typedef typename _Base::difference_type difference_type;
typedef _Tp value_type;
typedef _Allocator allocator_type;
typedef typename _Base::pointer pointer;
typedef typename _Base::const_pointer const_pointer;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
_Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; }
const _Base&
_M_base() const _GLIBCXX_NOEXCEPT { return *this; }
// 23.2.4.1 construct/copy/destroy:
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
explicit
vector(const _Allocator& __a = _Allocator())
: _Base(__a)
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. (_Hashtable<>::~_Hashtable): Use noexcept. * include/bits/stl_list.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use std::move on the allocator. (_Rb_tree<>::~_Rb_tree): Use noexcept. * include/bits/stl_deque.h: Likewise. * include/bits/basic_string.h (basic_string<>::~basic_string): Use noexcept. * include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise. * include/debug/set.h: Adjust. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/forward_list: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/ noexcept_move_construct.cc: New. * testsuite/21_strings/basic_string/cons/char/ noexcept_move_construct.cc: Likewise. * testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_map/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/forward_list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/bool/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/map/cons/noexcept_move_construct.cc * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * include/bits/move.h (swap): Use __and_ in the noexcept. * include/bits/algorithmfwd.h: Adjust. From-SVN: r174525
2011-06-01 16:16:19 +02:00
{
__profcxx_vector_construct(this, this->capacity());
__profcxx_vector_construct2(this);
}
#if __cplusplus >= 201103L
re PR libstdc++/32618 (std::vector calls uneccessary constructors instead of inplace construction of first object) 2010-06-18 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/32618 * include/bits/stl_list.h (vector<>::_M_default_initialize, _M_default_append): Declare. (list<>::list(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/list.tcc (list<>::resize, _M_default_append): Define. * include/bits/stl_vector.h (vector<>::_M_default_initialize, _M_default_append): Declare. (vector<>::vector(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/vector.tcc (vector<>::_M_default_append): Define. * include/bits/stl_deque.h (deque<>::_M_default_initialize, _M_default_append): Declare. (deque<>::deque(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/deque.tcc (deque<>::_M_default_append): Define. * include/debug/vector: Update. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/bits/forward_list.h (_M_default_initialize, _M_default_insert_after): Declare. (forward_list<>::forward_list(size_type), resize(size_type)): Fix, use the latter. * include/bits/forward_list.tcc (forward_list<>::_M_default_append, _M_default_insert_after): Define. * testsuite/util/testsuite_api.h (NonCopyConstructible): Add. * testsuite/23_containers/forward_list/modifiers/6.cc: Move to... * testsuite/23_containers/forward_list/capacity/resize_size.cc: ... here. * testsuite/23_containers/forward_list/cons/10.cc: Move to... * testsuite/23_containers/forward_list/cons/cons_size.cc: ... here. * testsuite/23_containers/vector/resize/1.cc: Move to... * testsuite/23_containers/vector/capacity/resize/1.cc: ... here. * testsuite/23_containers/vector/resize/moveable.cc: Move to... * testsuite/23_containers/vector/resize/capacity/moveable.cc: ... here. * testsuite/23_containers/vector/cons/cons_size.cc: New. * testsuite/23_containers/vector/capacity/resize/resize_size.cc: Likewise. * testsuite/23_containers/deque/cons/cons_size.cc: Likewise. * testsuite/23_containers/deque/capacity/resize_size.cc: Likewise. * testsuite/23_containers/list/cons/cons_size.cc: Likewise. * testsuite/23_containers/list/capacity/resize_size.cc: Likewise. * testsuite/23_containers/vector/capacity/resize/moveable.cc: Adjust. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r161009
2010-06-18 20:07:45 +02:00
explicit
vector(size_type __n, const _Allocator& __a = _Allocator())
: _Base(__n, __a)
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. (_Hashtable<>::~_Hashtable): Use noexcept. * include/bits/stl_list.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use std::move on the allocator. (_Rb_tree<>::~_Rb_tree): Use noexcept. * include/bits/stl_deque.h: Likewise. * include/bits/basic_string.h (basic_string<>::~basic_string): Use noexcept. * include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise. * include/debug/set.h: Adjust. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/forward_list: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/ noexcept_move_construct.cc: New. * testsuite/21_strings/basic_string/cons/char/ noexcept_move_construct.cc: Likewise. * testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_map/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/forward_list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/bool/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/map/cons/noexcept_move_construct.cc * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * include/bits/move.h (swap): Use __and_ in the noexcept. * include/bits/algorithmfwd.h: Adjust. From-SVN: r174525
2011-06-01 16:16:19 +02:00
{
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
__profcxx_vector_construct(this, this->capacity());
__profcxx_vector_construct2(this);
}
vector(size_type __n, const _Tp& __value,
const _Allocator& __a = _Allocator())
: _Base(__n, __value, __a)
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. (_Hashtable<>::~_Hashtable): Use noexcept. * include/bits/stl_list.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use std::move on the allocator. (_Rb_tree<>::~_Rb_tree): Use noexcept. * include/bits/stl_deque.h: Likewise. * include/bits/basic_string.h (basic_string<>::~basic_string): Use noexcept. * include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise. * include/debug/set.h: Adjust. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/forward_list: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/ noexcept_move_construct.cc: New. * testsuite/21_strings/basic_string/cons/char/ noexcept_move_construct.cc: Likewise. * testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_map/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/forward_list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/bool/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/map/cons/noexcept_move_construct.cc * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * include/bits/move.h (swap): Use __and_ in the noexcept. * include/bits/algorithmfwd.h: Adjust. From-SVN: r174525
2011-06-01 16:16:19 +02:00
{
__profcxx_vector_construct(this, this->capacity());
__profcxx_vector_construct2(this);
}
re PR libstdc++/32618 (std::vector calls uneccessary constructors instead of inplace construction of first object) 2010-06-18 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/32618 * include/bits/stl_list.h (vector<>::_M_default_initialize, _M_default_append): Declare. (list<>::list(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/list.tcc (list<>::resize, _M_default_append): Define. * include/bits/stl_vector.h (vector<>::_M_default_initialize, _M_default_append): Declare. (vector<>::vector(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/vector.tcc (vector<>::_M_default_append): Define. * include/bits/stl_deque.h (deque<>::_M_default_initialize, _M_default_append): Declare. (deque<>::deque(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/deque.tcc (deque<>::_M_default_append): Define. * include/debug/vector: Update. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/bits/forward_list.h (_M_default_initialize, _M_default_insert_after): Declare. (forward_list<>::forward_list(size_type), resize(size_type)): Fix, use the latter. * include/bits/forward_list.tcc (forward_list<>::_M_default_append, _M_default_insert_after): Define. * testsuite/util/testsuite_api.h (NonCopyConstructible): Add. * testsuite/23_containers/forward_list/modifiers/6.cc: Move to... * testsuite/23_containers/forward_list/capacity/resize_size.cc: ... here. * testsuite/23_containers/forward_list/cons/10.cc: Move to... * testsuite/23_containers/forward_list/cons/cons_size.cc: ... here. * testsuite/23_containers/vector/resize/1.cc: Move to... * testsuite/23_containers/vector/capacity/resize/1.cc: ... here. * testsuite/23_containers/vector/resize/moveable.cc: Move to... * testsuite/23_containers/vector/resize/capacity/moveable.cc: ... here. * testsuite/23_containers/vector/cons/cons_size.cc: New. * testsuite/23_containers/vector/capacity/resize/resize_size.cc: Likewise. * testsuite/23_containers/deque/cons/cons_size.cc: Likewise. * testsuite/23_containers/deque/capacity/resize_size.cc: Likewise. * testsuite/23_containers/list/cons/cons_size.cc: Likewise. * testsuite/23_containers/list/capacity/resize_size.cc: Likewise. * testsuite/23_containers/vector/capacity/resize/moveable.cc: Adjust. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r161009
2010-06-18 20:07:45 +02:00
#else
explicit
vector(size_type __n, const _Tp& __value = _Tp(),
const _Allocator& __a = _Allocator())
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. (_Hashtable<>::~_Hashtable): Use noexcept. * include/bits/stl_list.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use std::move on the allocator. (_Rb_tree<>::~_Rb_tree): Use noexcept. * include/bits/stl_deque.h: Likewise. * include/bits/basic_string.h (basic_string<>::~basic_string): Use noexcept. * include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise. * include/debug/set.h: Adjust. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/forward_list: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/ noexcept_move_construct.cc: New. * testsuite/21_strings/basic_string/cons/char/ noexcept_move_construct.cc: Likewise. * testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_map/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/forward_list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/bool/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/map/cons/noexcept_move_construct.cc * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * include/bits/move.h (swap): Use __and_ in the noexcept. * include/bits/algorithmfwd.h: Adjust. From-SVN: r174525
2011-06-01 16:16:19 +02:00
: _Base(__n, __value, __a)
{
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
__profcxx_vector_construct(this, this->capacity());
__profcxx_vector_construct2(this);
}
#endif
#if __cplusplus >= 201103L
template<typename _InputIterator,
typename = std::_RequireInputIter<_InputIterator>>
#else
template<typename _InputIterator>
#endif
vector(_InputIterator __first, _InputIterator __last,
const _Allocator& __a = _Allocator())
: _Base(__first, __last, __a)
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. (_Hashtable<>::~_Hashtable): Use noexcept. * include/bits/stl_list.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use std::move on the allocator. (_Rb_tree<>::~_Rb_tree): Use noexcept. * include/bits/stl_deque.h: Likewise. * include/bits/basic_string.h (basic_string<>::~basic_string): Use noexcept. * include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise. * include/debug/set.h: Adjust. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/forward_list: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/ noexcept_move_construct.cc: New. * testsuite/21_strings/basic_string/cons/char/ noexcept_move_construct.cc: Likewise. * testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_map/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/forward_list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/bool/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/map/cons/noexcept_move_construct.cc * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * include/bits/move.h (swap): Use __and_ in the noexcept. * include/bits/algorithmfwd.h: Adjust. From-SVN: r174525
2011-06-01 16:16:19 +02:00
{
__profcxx_vector_construct(this, this->capacity());
__profcxx_vector_construct2(this);
}
vector(const vector& __x)
: _Base(__x)
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. (_Hashtable<>::~_Hashtable): Use noexcept. * include/bits/stl_list.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use std::move on the allocator. (_Rb_tree<>::~_Rb_tree): Use noexcept. * include/bits/stl_deque.h: Likewise. * include/bits/basic_string.h (basic_string<>::~basic_string): Use noexcept. * include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise. * include/debug/set.h: Adjust. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/forward_list: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/ noexcept_move_construct.cc: New. * testsuite/21_strings/basic_string/cons/char/ noexcept_move_construct.cc: Likewise. * testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_map/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/forward_list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/bool/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/map/cons/noexcept_move_construct.cc * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * include/bits/move.h (swap): Use __and_ in the noexcept. * include/bits/algorithmfwd.h: Adjust. From-SVN: r174525
2011-06-01 16:16:19 +02:00
{
__profcxx_vector_construct(this, this->capacity());
__profcxx_vector_construct2(this);
}
/// Construction from a release-mode vector
vector(const _Base& __x)
: _Base(__x)
{
__profcxx_vector_construct(this, this->capacity());
__profcxx_vector_construct2(this);
}
#if __cplusplus >= 201103L
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. (_Hashtable<>::~_Hashtable): Use noexcept. * include/bits/stl_list.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use std::move on the allocator. (_Rb_tree<>::~_Rb_tree): Use noexcept. * include/bits/stl_deque.h: Likewise. * include/bits/basic_string.h (basic_string<>::~basic_string): Use noexcept. * include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise. * include/debug/set.h: Adjust. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/forward_list: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/ noexcept_move_construct.cc: New. * testsuite/21_strings/basic_string/cons/char/ noexcept_move_construct.cc: Likewise. * testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_map/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/forward_list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/bool/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/map/cons/noexcept_move_construct.cc * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * include/bits/move.h (swap): Use __and_ in the noexcept. * include/bits/algorithmfwd.h: Adjust. From-SVN: r174525
2011-06-01 16:16:19 +02:00
vector(vector&& __x) noexcept
move.h (forward): Update to N3092. 2010-08-05 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/move.h (forward): Update to N3092. (identity): Remove (US 92 is NAD). * include/debug/set.h: Fix move constructor to simply use move. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * include/ext/vstring.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_set.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/stl_bvector.h: Likewise. * testsuite/20_util/identity/value.cc: Remove * testsuite/20_util/identity/requirements/typedefs.cc: Likewise. * testsuite/20_util/identity/requirements/explicit_instantiation.cc: Likewise. From-SVN: r162898
2010-08-05 09:34:08 +02:00
: _Base(std::move(__x))
{
__profcxx_vector_construct(this, this->capacity());
__profcxx_vector_construct2(this);
}
vector(const _Base& __x, const _Allocator& __a)
: _Base(__x, __a)
{
__profcxx_vector_construct(this, this->capacity());
__profcxx_vector_construct2(this);
}
vector(vector&& __x, const _Allocator& __a) noexcept
: _Base(std::move(__x), __a)
{
__profcxx_vector_construct(this, this->capacity());
__profcxx_vector_construct2(this);
}
vector(initializer_list<value_type> __l,
const allocator_type& __a = allocator_type())
: _Base(__l, __a) { }
#endif
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept. (_Hashtable<>::~_Hashtable): Use noexcept. * include/bits/stl_list.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. * include/bits/stl_map.h (map<>::map(map&&)): Use noexcept. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use std::move on the allocator. (_Rb_tree<>::~_Rb_tree): Use noexcept. * include/bits/stl_deque.h: Likewise. * include/bits/basic_string.h (basic_string<>::~basic_string): Use noexcept. * include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise. * include/debug/set.h: Adjust. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/forward_list: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/ noexcept_move_construct.cc: New. * testsuite/21_strings/basic_string/cons/char/ noexcept_move_construct.cc: Likewise. * testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_map/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/forward_list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/bool/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/vector/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/list/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ noexcept_move_construct.cc: Likewise. * testsuite/23_containers/map/cons/noexcept_move_construct.cc * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. * include/bits/move.h (swap): Use __and_ in the noexcept. * include/bits/algorithmfwd.h: Adjust. From-SVN: r174525
2011-06-01 16:16:19 +02:00
~vector() _GLIBCXX_NOEXCEPT
{
__profcxx_vector_destruct(this, this->capacity(), this->size());
__profcxx_vector_destruct2(this);
}
vector&
operator=(const vector& __x)
{
static_cast<_Base&>(*this) = __x;
return *this;
}
#if __cplusplus >= 201103L
vector&
operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
{
__profcxx_vector_destruct(this, this->capacity(), this->size());
__profcxx_vector_destruct2(this);
static_cast<_Base&>(*this) = std::move(__x);
set.h: Revert last change, per DR 1204 [Ready]; mention the latter in comment. 2010-01-09 Paolo Carlini <paolo.carlini@oracle.com> * include/debug/set.h: Revert last change, per DR 1204 [Ready]; mention the latter in comment. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/profile/set.h: Likewise. * include/profile/unordered_map: Likewise. * include/profile/multiset.h: Likewise. * include/profile/unordered_set: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/map.h: Likewise. * include/profile/list: Likewise. * include/profile/multimap.h: Likewise. * include/ext/vstring.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_set.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/forward_list.h: Remove pre-existing check. * include/ext/vstring.h: Likewise. * testsuite/ext/vstring/cons/self_move_assign.cc: Remove. * testsuite/23_containers/unordered_map/cons/self_move_assign.cc: Likewise. * testsuite/23_containers/multimap/cons/self_move_assign.cc: Likewise. * testsuite/23_containers/set/cons/self_move_assign.cc: Likewise. * testsuite/23_containers/unordered_multimap/cons/ self_move_assign.cc: Likewise. * testsuite/23_containers/forward_list/cons/self_move_assign.cc: Likewise. * testsuite/23_containers/unordered_set/cons/self_move_assign.cc: Likewise. * testsuite/23_containers/vector/cons/self_move_assign.cc: Likewise. * testsuite/23_containers/deque/cons/self_move_assign.cc: Likewise. * testsuite/23_containers/multiset/cons/self_move_assign.cc: Likewise. * testsuite/23_containers/list/cons/self_move_assign.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/ self_move_assign.cc: Likewise. * testsuite/23_containers/map/cons/self_move_assign.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. * 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/forward_list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/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: r155756
2010-01-09 12:16:42 +01:00
return *this;
}
vector&
operator=(initializer_list<value_type> __l)
{
static_cast<_Base&>(*this) = __l;
return *this;
}
#endif
using _Base::assign;
using _Base::get_allocator;
// iterators:
iterator
begin() _GLIBCXX_NOEXCEPT
{ return iterator(_Base::begin(), this); }
const_iterator
begin() const _GLIBCXX_NOEXCEPT
{ return const_iterator(_Base::begin(), this); }
iterator
end() _GLIBCXX_NOEXCEPT
{ return iterator(_Base::end(), this); }
const_iterator
end() const _GLIBCXX_NOEXCEPT
{ return const_iterator(_Base::end(), this); }
reverse_iterator
rbegin() _GLIBCXX_NOEXCEPT
{ return reverse_iterator(end()); }
const_reverse_iterator
rbegin() const _GLIBCXX_NOEXCEPT
{ return const_reverse_iterator(end()); }
reverse_iterator
rend() _GLIBCXX_NOEXCEPT
{ return reverse_iterator(begin()); }
const_reverse_iterator
rend() const _GLIBCXX_NOEXCEPT
{ return const_reverse_iterator(begin()); }
#if __cplusplus >= 201103L
const_iterator
cbegin() const noexcept
{ return const_iterator(_Base::begin(), this); }
const_iterator
cend() const noexcept
{ return const_iterator(_Base::end(), this); }
const_reverse_iterator
crbegin() const noexcept
{ return const_reverse_iterator(end()); }
const_reverse_iterator
crend() const noexcept
{ return const_reverse_iterator(begin()); }
#endif
// 23.2.4.2 capacity:
using _Base::size;
using _Base::max_size;
#if __cplusplus >= 201103L
re PR libstdc++/32618 (std::vector calls uneccessary constructors instead of inplace construction of first object) 2010-06-18 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/32618 * include/bits/stl_list.h (vector<>::_M_default_initialize, _M_default_append): Declare. (list<>::list(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/list.tcc (list<>::resize, _M_default_append): Define. * include/bits/stl_vector.h (vector<>::_M_default_initialize, _M_default_append): Declare. (vector<>::vector(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/vector.tcc (vector<>::_M_default_append): Define. * include/bits/stl_deque.h (deque<>::_M_default_initialize, _M_default_append): Declare. (deque<>::deque(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/deque.tcc (deque<>::_M_default_append): Define. * include/debug/vector: Update. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/bits/forward_list.h (_M_default_initialize, _M_default_insert_after): Declare. (forward_list<>::forward_list(size_type), resize(size_type)): Fix, use the latter. * include/bits/forward_list.tcc (forward_list<>::_M_default_append, _M_default_insert_after): Define. * testsuite/util/testsuite_api.h (NonCopyConstructible): Add. * testsuite/23_containers/forward_list/modifiers/6.cc: Move to... * testsuite/23_containers/forward_list/capacity/resize_size.cc: ... here. * testsuite/23_containers/forward_list/cons/10.cc: Move to... * testsuite/23_containers/forward_list/cons/cons_size.cc: ... here. * testsuite/23_containers/vector/resize/1.cc: Move to... * testsuite/23_containers/vector/capacity/resize/1.cc: ... here. * testsuite/23_containers/vector/resize/moveable.cc: Move to... * testsuite/23_containers/vector/resize/capacity/moveable.cc: ... here. * testsuite/23_containers/vector/cons/cons_size.cc: New. * testsuite/23_containers/vector/capacity/resize/resize_size.cc: Likewise. * testsuite/23_containers/deque/cons/cons_size.cc: Likewise. * testsuite/23_containers/deque/capacity/resize_size.cc: Likewise. * testsuite/23_containers/list/cons/cons_size.cc: Likewise. * testsuite/23_containers/list/capacity/resize_size.cc: Likewise. * testsuite/23_containers/vector/capacity/resize/moveable.cc: Adjust. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r161009
2010-06-18 20:07:45 +02:00
void
resize(size_type __sz)
{
__profcxx_vector_invalid_operator(this);
_M_profile_resize(this, this->capacity(), __sz);
_Base::resize(__sz);
}
void
resize(size_type __sz, const _Tp& __c)
{
__profcxx_vector_invalid_operator(this);
_M_profile_resize(this, this->capacity(), __sz);
_Base::resize(__sz, __c);
}
#else
void
resize(size_type __sz, _Tp __c = _Tp())
{
__profcxx_vector_invalid_operator(this);
_M_profile_resize(this, this->capacity(), __sz);
_Base::resize(__sz, __c);
}
re PR libstdc++/32618 (std::vector calls uneccessary constructors instead of inplace construction of first object) 2010-06-18 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/32618 * include/bits/stl_list.h (vector<>::_M_default_initialize, _M_default_append): Declare. (list<>::list(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/list.tcc (list<>::resize, _M_default_append): Define. * include/bits/stl_vector.h (vector<>::_M_default_initialize, _M_default_append): Declare. (vector<>::vector(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/vector.tcc (vector<>::_M_default_append): Define. * include/bits/stl_deque.h (deque<>::_M_default_initialize, _M_default_append): Declare. (deque<>::deque(size_type), resize(size_type)): Add in C++0x mode, use the latter. * include/bits/deque.tcc (deque<>::_M_default_append): Define. * include/debug/vector: Update. * include/debug/deque: Likewise. * include/debug/list: Likewise. * include/profile/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/bits/forward_list.h (_M_default_initialize, _M_default_insert_after): Declare. (forward_list<>::forward_list(size_type), resize(size_type)): Fix, use the latter. * include/bits/forward_list.tcc (forward_list<>::_M_default_append, _M_default_insert_after): Define. * testsuite/util/testsuite_api.h (NonCopyConstructible): Add. * testsuite/23_containers/forward_list/modifiers/6.cc: Move to... * testsuite/23_containers/forward_list/capacity/resize_size.cc: ... here. * testsuite/23_containers/forward_list/cons/10.cc: Move to... * testsuite/23_containers/forward_list/cons/cons_size.cc: ... here. * testsuite/23_containers/vector/resize/1.cc: Move to... * testsuite/23_containers/vector/capacity/resize/1.cc: ... here. * testsuite/23_containers/vector/resize/moveable.cc: Move to... * testsuite/23_containers/vector/resize/capacity/moveable.cc: ... here. * testsuite/23_containers/vector/cons/cons_size.cc: New. * testsuite/23_containers/vector/capacity/resize/resize_size.cc: Likewise. * testsuite/23_containers/deque/cons/cons_size.cc: Likewise. * testsuite/23_containers/deque/capacity/resize_size.cc: Likewise. * testsuite/23_containers/list/cons/cons_size.cc: Likewise. * testsuite/23_containers/list/capacity/resize_size.cc: Likewise. * testsuite/23_containers/vector/capacity/resize/moveable.cc: Adjust. * testsuite/23_containers/deque/capacity/moveable.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r161009
2010-06-18 20:07:45 +02:00
#endif
#if __cplusplus >= 201103L
re PR libstdc++/42573 ([C++0x] shrink_to_fit() missing) 2010-01-08 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/42573 * include/bits/allocator.h (struct __shrink_to_fit): Add. * include/bits/stl_deque.h (deque<>::shrink_to_fit): Add. * include/bits/stl_vector.h (vector<>::shrink_to_fit): Likewise. * include/bits/stl_bvector.h (vector<bool>::shrink_to_fit): Likewise. * include/bits/basic_string.h (basic_string<>::shrink_to_fit): Likewise. * include/ext/vstring.h (__versa_string<>::shrink_to_fit): Likewise. * include/debug/deque: Add corresponding using declaration. * include/debug/vector: Likewise. * include/debug/string: Likewise. * include/profile/deque: Likewise. * include/profile/vector: Likewise. * config/abi/pre/gnu.ver: Export new symbols. * testsuite/23_containers/deque/capacity/shrink_to_fit.cc: New. * testsuite/23_containers/vector/capacity/shrink_to_fit.cc: Likewise. * testsuite/21_strings/basic_string/capacity/char/shrink_to_fit.cc: Likewise. * testsuite/21_strings/basic_string/capacity/wchar_t/shrink_to_fit.cc: Likewise. * testsuite/ext/vstring/capacity/shrink_to_fit.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r155733
2010-01-08 14:01:24 +01:00
using _Base::shrink_to_fit;
#endif
using _Base::empty;
// element access:
reference
operator[](size_type __n)
{
__profcxx_vector_invalid_operator(this);
return _M_base()[__n];
}
const_reference
operator[](size_type __n) const
{
__profcxx_vector_invalid_operator(this);
return _M_base()[__n];
}
using _Base::at;
reference
front()
{
return _Base::front();
}
const_reference
front() const
{
return _Base::front();
}
reference
back()
{
return _Base::back();
}
const_reference
back() const
{
return _Base::back();
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 464. Suggestion for new member functions in standard containers.
using _Base::data;
// 23.2.4.3 modifiers:
void
push_back(const _Tp& __x)
{
size_type __old_size = this->capacity();
_Base::push_back(__x);
_M_profile_resize(this, __old_size, this->capacity());
}
#if __cplusplus >= 201103L
void
push_back(_Tp&& __x)
{
size_type __old_size = this->capacity();
_Base::push_back(std::move(__x));
_M_profile_resize(this, __old_size, this->capacity());
}
#endif
iterator
insert(iterator __position, const _Tp& __x)
{
__profcxx_vector_insert(this, __position.base() - _Base::begin(),
this->size());
size_type __old_size = this->capacity();
typename _Base::iterator __res = _Base::insert(__position.base(), __x);
_M_profile_resize(this, __old_size, this->capacity());
return iterator(__res, this);
}
#if __cplusplus >= 201103L
iterator
insert(iterator __position, _Tp&& __x)
{
__profcxx_vector_insert(this, __position.base() - _Base::begin(),
this->size());
size_type __old_size = this->capacity();
typename _Base::iterator __res = _Base::insert(__position.base(), __x);
_M_profile_resize(this, __old_size, this->capacity());
return iterator(__res, this);
}
void
insert(iterator __position, initializer_list<value_type> __l)
{ this->insert(__position, __l.begin(), __l.end()); }
#endif
#if __cplusplus >= 201103L
void
swap(vector&& __x)
{
_Base::swap(__x);
}
#endif
void
swap(vector& __x)
#if __cplusplus >= 201103L
noexcept(_Alloc_traits::_S_nothrow_swap())
#endif
{
_Base::swap(__x);
}
void
insert(iterator __position, size_type __n, const _Tp& __x)
{
__profcxx_vector_insert(this, __position.base() - _Base::begin(),
this->size());
size_type __old_size = this->capacity();
_Base::insert(__position, __n, __x);
_M_profile_resize(this, __old_size, this->capacity());
}
#if __cplusplus >= 201103L
template<typename _InputIterator,
typename = std::_RequireInputIter<_InputIterator>>
#else
template<typename _InputIterator>
#endif
void
insert(iterator __position,
_InputIterator __first, _InputIterator __last)
{
__profcxx_vector_insert(this, __position.base()-_Base::begin(),
this->size());
size_type __old_size = this->capacity();
_Base::insert(__position, __first, __last);
_M_profile_resize(this, __old_size, this->capacity());
}
iterator
erase(iterator __position)
{
typename _Base::iterator __res = _Base::erase(__position.base());
return iterator(__res, this);
}
iterator
erase(iterator __first, iterator __last)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 151. can't currently clear() empty container
typename _Base::iterator __res = _Base::erase(__first.base(),
__last.base());
return iterator(__res, this);
}
void
clear() _GLIBCXX_NOEXCEPT
{
__profcxx_vector_destruct(this, this->capacity(), this->size());
__profcxx_vector_destruct2(this);
_Base::clear();
}
inline void _M_profile_find() const
{
__profcxx_vector_find(this, size());
}
inline void _M_profile_iterate(int __rewind = 0) const
{
__profcxx_vector_iterate(this);
}
private:
void _M_profile_resize(void* obj, size_type __old_size,
size_type __new_size)
{
if (__old_size < __new_size) {
__profcxx_vector_resize(this, this->size(), __new_size);
__profcxx_vector_resize2(this, this->size(), __new_size);
}
}
};
template<typename _Tp, typename _Alloc>
inline bool
operator==(const vector<_Tp, _Alloc>& __lhs,
const vector<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() == __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator!=(const vector<_Tp, _Alloc>& __lhs,
const vector<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() != __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator<(const vector<_Tp, _Alloc>& __lhs,
const vector<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() < __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator<=(const vector<_Tp, _Alloc>& __lhs,
const vector<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() <= __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator>=(const vector<_Tp, _Alloc>& __lhs,
const vector<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() >= __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator>(const vector<_Tp, _Alloc>& __lhs,
const vector<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() > __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline void
swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>& __rhs)
{ __lhs.swap(__rhs); }
#if __cplusplus >= 201103L
template<typename _Tp, typename _Alloc>
inline void
swap(vector<_Tp, _Alloc>&& __lhs, vector<_Tp, _Alloc>& __rhs)
{ __lhs.swap(__rhs); }
template<typename _Tp, typename _Alloc>
inline void
swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>&& __rhs)
{ __lhs.swap(__rhs); }
#endif
} // namespace __profile
#if __cplusplus >= 201103L
// DR 1182.
/// std::hash specialization for vector<bool>.
template<typename _Alloc>
struct hash<__profile::vector<bool, _Alloc>>
: public __hash_base<size_t, __profile::vector<bool, _Alloc>>
{
size_t
hash-long-double-aux.cc: Rename to... 2011-11-18 Paolo Carlini <paolo.carlini@oracle.com> * src/hash-long-double-aux.cc: Rename to... * src/hash-long-double-tr1-aux.cc: ... this. * src/compatibility-ldbl.cc: Adjust. * src/hash_tr1.cc: Likewise. * src/hash_c++0x.cc: Don't use src/hash-long-double-aux.cc. * include/bits/functional_hash.h (hash<_Tp*>::operator(), specs for integer types, hash<float>::operator(), hash<double>::operator(), hash<long double>::operator()): Declare noexcept. * include/debug/bitset (hash<__debug::bitset>::operator()): Likewise. * include/debug/vector (hash<__debug::vector>::operator()): Likewise. * include/std/system_error (hash<error_code>::operator()): Likewise. * include/std/thread (hash<thread::id>::operator()): Likewise. * include/std/bitset (hash<bitset>::operator()): Likewise. * include/std/typeindex (hash<type_index>::operator()): Likewise. * include/profile/bitset (hash<__profile::vector>::operator()): Likewise. * include/profile/vector (hash<__profile::vector>::operator()): Likewise. * include/ext/vstring.h (hash<__vstring>::operator(), hash<__wvstring>::operator(), hash<__u16vstring>::operator(), hash<__u32vstring>::operator()): Likewise. * include/bits/shared_ptr.h (hash<shared_ptr>::operator()): Likewise. * include/bits/shared_ptr_base.h (hash<__shared_ptr>::operator()): Likewise. * include/bits/unique_ptr.h (hash<unique_ptr>::operator()): Likewise. * include/bits/basic_string.h (hash<string>::operator(), hash<wstring>::operator(), hash<u16string>::operator(), hash<u32string>::operator()): Likewise. * include/bits/vector.tcc (hash<vector>::operator()): Likewise. * include/bits/stl_bvector.h (hash<vector>::operator()): Likewise. * libsupc++/typeinfo (type_info::hash_code): Use noexcept instead of throw(). From-SVN: r181473
2011-11-18 13:37:06 +01:00
operator()(const __profile::vector<bool, _Alloc>& __b) const noexcept
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
{ return std::hash<_GLIBCXX_STD_C::vector<bool, _Alloc>>()
(__b._M_base()); }
};
#endif
} // namespace std
#endif