2009-10-03 04:17:41 +02:00
|
|
|
// Profiling deque implementation -*- C++ -*-
|
|
|
|
|
2013-02-03 18:54:05 +01:00
|
|
|
// Copyright (C) 2009-2013 Free Software Foundation, Inc.
|
2009-10-03 04:17:41 +02:00
|
|
|
//
|
|
|
|
// This file is part of the GNU ISO C++ Library. This library is free
|
|
|
|
// software; you can redistribute it and/or modify it under the
|
|
|
|
// terms of the GNU General Public License as published by the
|
|
|
|
// Free Software Foundation; either version 3, or (at your option)
|
|
|
|
// any later version.
|
|
|
|
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
// permissions described in the GCC Runtime Library Exception, version
|
|
|
|
// 3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License and
|
|
|
|
// a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
// <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
/** @file profile/deque
|
|
|
|
* This file is a GNU profile extension to the Standard C++ Library.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GLIBCXX_PROFILE_DEQUE
|
|
|
|
#define _GLIBCXX_PROFILE_DEQUE 1
|
|
|
|
|
|
|
|
#include <deque>
|
|
|
|
|
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)
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
namespace __profile
|
|
|
|
{
|
2009-11-17 21:45:32 +01:00
|
|
|
/// Class std::deque wrapper with performance instrumentation.
|
2009-10-03 04:17:41 +02:00
|
|
|
template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
|
|
|
|
class deque
|
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::deque<_Tp, _Allocator>
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
typedef _GLIBCXX_STD_C::deque<_Tp, _Allocator> _Base;
|
2009-10-03 04:17:41 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
typedef typename _Base::reference reference;
|
|
|
|
typedef typename _Base::const_reference const_reference;
|
|
|
|
|
|
|
|
typedef typename _Base::iterator iterator;
|
|
|
|
typedef typename _Base::const_iterator const_iterator;
|
|
|
|
typedef typename _Base::reverse_iterator reverse_iterator;
|
|
|
|
typedef typename _Base::const_reverse_iterator const_reverse_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;
|
|
|
|
|
|
|
|
// 23.2.1.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
|
|
|
|
deque(const _Allocator& __a = _Allocator())
|
2009-10-03 04:17:41 +02:00
|
|
|
: _Base(__a) { }
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
re PR libstdc++/32618 (std::vector calls uneccessary constructors instead of inplace construction of first object)
2010-06-18 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/32618
* include/bits/stl_list.h (vector<>::_M_default_initialize,
_M_default_append): Declare.
(list<>::list(size_type), resize(size_type)): Add in C++0x mode,
use the latter.
* include/bits/list.tcc (list<>::resize, _M_default_append): Define.
* include/bits/stl_vector.h (vector<>::_M_default_initialize,
_M_default_append): Declare.
(vector<>::vector(size_type), resize(size_type)): Add in C++0x mode,
use the latter.
* include/bits/vector.tcc (vector<>::_M_default_append): Define.
* include/bits/stl_deque.h (deque<>::_M_default_initialize,
_M_default_append): Declare.
(deque<>::deque(size_type), resize(size_type)): Add in C++0x mode,
use the latter.
* include/bits/deque.tcc (deque<>::_M_default_append): Define.
* include/debug/vector: Update.
* include/debug/deque: Likewise.
* include/debug/list: Likewise.
* include/profile/vector: Likewise.
* include/profile/deque: Likewise.
* include/profile/list: Likewise.
* include/bits/forward_list.h (_M_default_initialize,
_M_default_insert_after): Declare.
(forward_list<>::forward_list(size_type), resize(size_type)): Fix,
use the latter.
* include/bits/forward_list.tcc (forward_list<>::_M_default_append,
_M_default_insert_after): Define.
* testsuite/util/testsuite_api.h (NonCopyConstructible): Add.
* testsuite/23_containers/forward_list/modifiers/6.cc: Move to...
* testsuite/23_containers/forward_list/capacity/resize_size.cc:
... here.
* testsuite/23_containers/forward_list/cons/10.cc: Move to...
* testsuite/23_containers/forward_list/cons/cons_size.cc: ... here.
* testsuite/23_containers/vector/resize/1.cc: Move to...
* testsuite/23_containers/vector/capacity/resize/1.cc: ... here.
* testsuite/23_containers/vector/resize/moveable.cc: Move to...
* testsuite/23_containers/vector/resize/capacity/moveable.cc: ... here.
* testsuite/23_containers/vector/cons/cons_size.cc: New.
* testsuite/23_containers/vector/capacity/resize/resize_size.cc:
Likewise.
* testsuite/23_containers/deque/cons/cons_size.cc: Likewise.
* testsuite/23_containers/deque/capacity/resize_size.cc: Likewise.
* testsuite/23_containers/list/cons/cons_size.cc: Likewise.
* testsuite/23_containers/list/capacity/resize_size.cc: Likewise.
* testsuite/23_containers/vector/capacity/resize/moveable.cc: Adjust.
* testsuite/23_containers/deque/capacity/moveable.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Adjust dg-error line numbers.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
assign_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
assign_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Likewise.
From-SVN: r161009
2010-06-18 20:07:45 +02:00
|
|
|
explicit
|
|
|
|
deque(size_type __n)
|
|
|
|
: _Base(__n) { }
|
|
|
|
|
|
|
|
deque(size_type __n, const _Tp& __value,
|
|
|
|
const _Allocator& __a = _Allocator())
|
2009-10-03 04:17:41 +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
|
|
|
#else
|
|
|
|
explicit
|
|
|
|
deque(size_type __n, const _Tp& __value = _Tp(),
|
|
|
|
const _Allocator& __a = _Allocator())
|
|
|
|
: _Base(__n, __value, __a) { }
|
|
|
|
#endif
|
2009-10-03 04:17:41 +02:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2012-11-06 01:06:42 +01:00
|
|
|
template<typename _InputIterator,
|
|
|
|
typename = std::_RequireInputIter<_InputIterator>>
|
|
|
|
#else
|
|
|
|
template<typename _InputIterator>
|
|
|
|
#endif
|
2009-10-03 04:17:41 +02:00
|
|
|
deque(_InputIterator __first, _InputIterator __last,
|
|
|
|
const _Allocator& __a = _Allocator())
|
|
|
|
: _Base(__first, __last, __a)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
deque(const deque& __x)
|
|
|
|
: _Base(__x) { }
|
|
|
|
|
|
|
|
deque(const _Base& __x)
|
|
|
|
: _Base(__x) { }
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2009-10-03 04:17:41 +02:00
|
|
|
deque(deque&& __x)
|
2010-08-05 09:34:08 +02:00
|
|
|
: _Base(std::move(__x))
|
2009-10-03 04:17:41 +02:00
|
|
|
{ }
|
|
|
|
|
|
|
|
deque(initializer_list<value_type> __l,
|
|
|
|
const allocator_type& __a = allocator_type())
|
|
|
|
: _Base(__l, __a) { }
|
|
|
|
#endif
|
|
|
|
|
2011-06-01 16:16:19 +02:00
|
|
|
~deque() _GLIBCXX_NOEXCEPT { }
|
2009-10-03 04:17:41 +02:00
|
|
|
|
|
|
|
deque&
|
|
|
|
operator=(const deque& __x)
|
|
|
|
{
|
|
|
|
*static_cast<_Base*>(this) = __x;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2009-10-03 04:17:41 +02:00
|
|
|
deque&
|
|
|
|
operator=(deque&& __x)
|
|
|
|
{
|
2010-01-09 12:16:42 +01:00
|
|
|
// NB: DR 1204.
|
|
|
|
// NB: DR 675.
|
|
|
|
this->clear();
|
|
|
|
this->swap(__x);
|
2009-10-03 04:17:41 +02:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
deque&
|
|
|
|
operator=(initializer_list<value_type> __l)
|
|
|
|
{
|
|
|
|
*static_cast<_Base*>(this) = __l;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2012-11-06 01:06:42 +01:00
|
|
|
template<typename _InputIterator,
|
|
|
|
typename = std::_RequireInputIter<_InputIterator>>
|
|
|
|
#else
|
|
|
|
template<typename _InputIterator>
|
|
|
|
#endif
|
2009-10-03 04:17:41 +02:00
|
|
|
void
|
|
|
|
assign(_InputIterator __first, _InputIterator __last)
|
|
|
|
{
|
|
|
|
_Base::assign(__first, __last);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
assign(size_type __n, const _Tp& __t)
|
|
|
|
{
|
|
|
|
_Base::assign(__n, __t);
|
|
|
|
}
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2009-10-03 04:17:41 +02:00
|
|
|
void
|
|
|
|
assign(initializer_list<value_type> __l)
|
|
|
|
{
|
|
|
|
_Base::assign(__l);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
using _Base::get_allocator;
|
|
|
|
|
|
|
|
// iterators:
|
|
|
|
iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
begin() _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return iterator(_Base::begin()); }
|
|
|
|
|
|
|
|
const_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
begin() const _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return const_iterator(_Base::begin()); }
|
|
|
|
|
|
|
|
iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
end() _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return iterator(_Base::end()); }
|
|
|
|
|
|
|
|
const_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
end() const _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return const_iterator(_Base::end()); }
|
|
|
|
|
|
|
|
reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
rbegin() _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return reverse_iterator(end()); }
|
|
|
|
|
|
|
|
const_reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
rbegin() const _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return const_reverse_iterator(end()); }
|
|
|
|
|
|
|
|
reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
rend() _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return reverse_iterator(begin()); }
|
|
|
|
|
|
|
|
const_reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
rend() const _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return const_reverse_iterator(begin()); }
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2009-10-03 04:17:41 +02:00
|
|
|
const_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
cbegin() const noexcept
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return const_iterator(_Base::begin()); }
|
|
|
|
|
|
|
|
const_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
cend() const noexcept
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return const_iterator(_Base::end()); }
|
|
|
|
|
|
|
|
const_reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
crbegin() const noexcept
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return const_reverse_iterator(end()); }
|
|
|
|
|
|
|
|
const_reverse_iterator
|
2011-05-26 17:35:02 +02:00
|
|
|
crend() const noexcept
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return const_reverse_iterator(begin()); }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// 23.2.1.2 capacity:
|
|
|
|
using _Base::size;
|
|
|
|
using _Base::max_size;
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
re PR libstdc++/32618 (std::vector calls uneccessary constructors instead of inplace construction of first object)
2010-06-18 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/32618
* include/bits/stl_list.h (vector<>::_M_default_initialize,
_M_default_append): Declare.
(list<>::list(size_type), resize(size_type)): Add in C++0x mode,
use the latter.
* include/bits/list.tcc (list<>::resize, _M_default_append): Define.
* include/bits/stl_vector.h (vector<>::_M_default_initialize,
_M_default_append): Declare.
(vector<>::vector(size_type), resize(size_type)): Add in C++0x mode,
use the latter.
* include/bits/vector.tcc (vector<>::_M_default_append): Define.
* include/bits/stl_deque.h (deque<>::_M_default_initialize,
_M_default_append): Declare.
(deque<>::deque(size_type), resize(size_type)): Add in C++0x mode,
use the latter.
* include/bits/deque.tcc (deque<>::_M_default_append): Define.
* include/debug/vector: Update.
* include/debug/deque: Likewise.
* include/debug/list: Likewise.
* include/profile/vector: Likewise.
* include/profile/deque: Likewise.
* include/profile/list: Likewise.
* include/bits/forward_list.h (_M_default_initialize,
_M_default_insert_after): Declare.
(forward_list<>::forward_list(size_type), resize(size_type)): Fix,
use the latter.
* include/bits/forward_list.tcc (forward_list<>::_M_default_append,
_M_default_insert_after): Define.
* testsuite/util/testsuite_api.h (NonCopyConstructible): Add.
* testsuite/23_containers/forward_list/modifiers/6.cc: Move to...
* testsuite/23_containers/forward_list/capacity/resize_size.cc:
... here.
* testsuite/23_containers/forward_list/cons/10.cc: Move to...
* testsuite/23_containers/forward_list/cons/cons_size.cc: ... here.
* testsuite/23_containers/vector/resize/1.cc: Move to...
* testsuite/23_containers/vector/capacity/resize/1.cc: ... here.
* testsuite/23_containers/vector/resize/moveable.cc: Move to...
* testsuite/23_containers/vector/resize/capacity/moveable.cc: ... here.
* testsuite/23_containers/vector/cons/cons_size.cc: New.
* testsuite/23_containers/vector/capacity/resize/resize_size.cc:
Likewise.
* testsuite/23_containers/deque/cons/cons_size.cc: Likewise.
* testsuite/23_containers/deque/capacity/resize_size.cc: Likewise.
* testsuite/23_containers/list/cons/cons_size.cc: Likewise.
* testsuite/23_containers/list/capacity/resize_size.cc: Likewise.
* testsuite/23_containers/vector/capacity/resize/moveable.cc: Adjust.
* testsuite/23_containers/deque/capacity/moveable.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Adjust dg-error line numbers.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
assign_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
assign_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Likewise.
From-SVN: r161009
2010-06-18 20:07:45 +02:00
|
|
|
void
|
|
|
|
resize(size_type __sz)
|
|
|
|
{
|
|
|
|
_Base::resize(__sz);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
resize(size_type __sz, const _Tp& __c)
|
|
|
|
{
|
|
|
|
_Base::resize(__sz, __c);
|
|
|
|
}
|
|
|
|
#else
|
2009-10-03 04:17:41 +02:00
|
|
|
void
|
|
|
|
resize(size_type __sz, _Tp __c = _Tp())
|
|
|
|
{
|
|
|
|
_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
|
2009-10-03 04:17:41 +02:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2010-01-08 14:01:24 +01:00
|
|
|
using _Base::shrink_to_fit;
|
|
|
|
#endif
|
|
|
|
|
2009-10-03 04:17:41 +02:00
|
|
|
using _Base::empty;
|
|
|
|
|
|
|
|
// element access:
|
|
|
|
reference
|
|
|
|
operator[](size_type __n)
|
|
|
|
{
|
|
|
|
return _M_base()[__n];
|
|
|
|
}
|
|
|
|
|
|
|
|
const_reference
|
|
|
|
operator[](size_type __n) const
|
|
|
|
{
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
// 23.2.1.3 modifiers:
|
|
|
|
void
|
|
|
|
push_front(const _Tp& __x)
|
|
|
|
{
|
|
|
|
_Base::push_front(__x);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
push_back(const _Tp& __x)
|
|
|
|
{
|
|
|
|
_Base::push_back(__x);
|
|
|
|
}
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2009-10-03 04:17:41 +02:00
|
|
|
void
|
|
|
|
push_front(_Tp&& __x)
|
|
|
|
{ emplace_front(std::move(__x)); }
|
|
|
|
|
|
|
|
void
|
|
|
|
push_back(_Tp&& __x)
|
|
|
|
{ emplace_back(std::move(__x)); }
|
|
|
|
|
|
|
|
template<typename... _Args>
|
|
|
|
void
|
|
|
|
emplace_front(_Args&&... __args)
|
|
|
|
{
|
|
|
|
_Base::emplace_front(std::forward<_Args>(__args)...);
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename... _Args>
|
|
|
|
void
|
|
|
|
emplace_back(_Args&&... __args)
|
|
|
|
{
|
|
|
|
_Base::emplace_back(std::forward<_Args>(__args)...);
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename... _Args>
|
|
|
|
iterator
|
|
|
|
emplace(iterator __position, _Args&&... __args)
|
|
|
|
{
|
|
|
|
typename _Base::iterator __res = _Base::emplace(__position,
|
|
|
|
std::forward<_Args>(__args)...);
|
|
|
|
return iterator(__res);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
iterator
|
|
|
|
insert(iterator __position, const _Tp& __x)
|
|
|
|
{
|
|
|
|
typename _Base::iterator __res = _Base::insert(__position, __x);
|
|
|
|
return iterator(__res);
|
|
|
|
}
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2009-10-03 04:17:41 +02:00
|
|
|
iterator
|
|
|
|
insert(iterator __position, _Tp&& __x)
|
|
|
|
{ return emplace(__position, std::move(__x)); }
|
|
|
|
|
|
|
|
void
|
|
|
|
insert(iterator __p, initializer_list<value_type> __l)
|
|
|
|
{
|
|
|
|
_Base::insert(__p, __l);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void
|
|
|
|
insert(iterator __position, size_type __n, const _Tp& __x)
|
|
|
|
{
|
|
|
|
_Base::insert(__position, __n, __x);
|
|
|
|
}
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2012-11-06 01:06:42 +01:00
|
|
|
template<typename _InputIterator,
|
|
|
|
typename = std::_RequireInputIter<_InputIterator>>
|
|
|
|
#else
|
|
|
|
template<typename _InputIterator>
|
|
|
|
#endif
|
2009-10-03 04:17:41 +02:00
|
|
|
void
|
|
|
|
insert(iterator __position,
|
|
|
|
_InputIterator __first, _InputIterator __last)
|
|
|
|
{
|
|
|
|
_Base::insert(__position, __first, __last);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
pop_front()
|
|
|
|
{
|
|
|
|
_Base::pop_front();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
pop_back()
|
|
|
|
{
|
|
|
|
_Base::pop_back();
|
|
|
|
}
|
|
|
|
|
|
|
|
iterator
|
|
|
|
erase(iterator __position)
|
|
|
|
{
|
|
|
|
if (__position == begin() || __position == end()-1)
|
|
|
|
{
|
|
|
|
return iterator(_Base::erase(__position));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
typename _Base::iterator __res = _Base::erase(__position);
|
|
|
|
return iterator(__res);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
iterator
|
|
|
|
erase(iterator __first, iterator __last)
|
|
|
|
{
|
|
|
|
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
|
|
|
// 151. can't currently clear() empty container
|
|
|
|
return iterator(_Base::erase(__first, __last));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
swap(deque& __x)
|
|
|
|
{
|
|
|
|
_Base::swap(__x);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-05-26 17:35:02 +02:00
|
|
|
clear() _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
_Base::clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
_Base&
|
2011-05-26 17:35:02 +02:00
|
|
|
_M_base() _GLIBCXX_NOEXCEPT { return *this; }
|
2009-10-03 04:17:41 +02:00
|
|
|
|
|
|
|
const _Base&
|
2011-05-26 17:35:02 +02:00
|
|
|
_M_base() const _GLIBCXX_NOEXCEPT { return *this; }
|
2009-10-03 04:17:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline bool
|
|
|
|
operator==(const deque<_Tp, _Alloc>& __lhs,
|
|
|
|
const deque<_Tp, _Alloc>& __rhs)
|
|
|
|
{ return __lhs._M_base() == __rhs._M_base(); }
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline bool
|
|
|
|
operator!=(const deque<_Tp, _Alloc>& __lhs,
|
|
|
|
const deque<_Tp, _Alloc>& __rhs)
|
|
|
|
{ return __lhs._M_base() != __rhs._M_base(); }
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline bool
|
|
|
|
operator<(const deque<_Tp, _Alloc>& __lhs,
|
|
|
|
const deque<_Tp, _Alloc>& __rhs)
|
|
|
|
{ return __lhs._M_base() < __rhs._M_base(); }
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline bool
|
|
|
|
operator<=(const deque<_Tp, _Alloc>& __lhs,
|
|
|
|
const deque<_Tp, _Alloc>& __rhs)
|
|
|
|
{ return __lhs._M_base() <= __rhs._M_base(); }
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline bool
|
|
|
|
operator>=(const deque<_Tp, _Alloc>& __lhs,
|
|
|
|
const deque<_Tp, _Alloc>& __rhs)
|
|
|
|
{ return __lhs._M_base() >= __rhs._M_base(); }
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline bool
|
|
|
|
operator>(const deque<_Tp, _Alloc>& __lhs,
|
|
|
|
const deque<_Tp, _Alloc>& __rhs)
|
|
|
|
{ return __lhs._M_base() > __rhs._M_base(); }
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline void
|
|
|
|
swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>& __rhs)
|
|
|
|
{ __lhs.swap(__rhs); }
|
|
|
|
|
|
|
|
} // namespace __profile
|
|
|
|
} // namespace std
|
|
|
|
|
|
|
|
#endif
|