2003-11-11 21:09:16 +01:00
|
|
|
// Debugging vector implementation -*- C++ -*-
|
|
|
|
|
2008-05-10 17:02:34 +02:00
|
|
|
// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
|
2003-11-11 21:09:16 +01:00
|
|
|
// 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 2, 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.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
|
|
// with this library; see the file COPYING. If not, write to the Free
|
2005-08-17 04:28:44 +02:00
|
|
|
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
2003-11-11 21:09:16 +01:00
|
|
|
// USA.
|
|
|
|
|
|
|
|
// As a special exception, you may use this file as part of a free software
|
|
|
|
// library without restriction. Specifically, if other files instantiate
|
|
|
|
// templates or use macros or inline functions from this file, or you compile
|
|
|
|
// this file and link it with other files to produce an executable, this
|
|
|
|
// file does not by itself cause the resulting executable to be covered by
|
|
|
|
// the GNU General Public License. This exception does not however
|
|
|
|
// invalidate any other reasons why the executable file might be covered by
|
|
|
|
// the GNU General Public License.
|
|
|
|
|
2006-11-29 21:59:22 +01:00
|
|
|
/** @file debug/vector
|
|
|
|
* This file is a GNU debug extension to the Standard C++ Library.
|
|
|
|
*/
|
|
|
|
|
2003-11-11 21:09:16 +01:00
|
|
|
#ifndef _GLIBCXX_DEBUG_VECTOR
|
|
|
|
#define _GLIBCXX_DEBUG_VECTOR 1
|
|
|
|
|
|
|
|
#include <vector>
|
2005-05-27 17:01:45 +02:00
|
|
|
#include <utility>
|
2003-11-11 21:09:16 +01:00
|
|
|
#include <debug/safe_sequence.h>
|
|
|
|
#include <debug/safe_iterator.h>
|
|
|
|
|
2005-12-19 01:56:05 +01:00
|
|
|
namespace std
|
|
|
|
{
|
2006-02-22 01:57:24 +01:00
|
|
|
namespace __debug
|
2003-11-11 21:09:16 +01:00
|
|
|
{
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
template<typename _Tp,
|
2003-11-11 21:09:16 +01:00
|
|
|
typename _Allocator = std::allocator<_Tp> >
|
|
|
|
class vector
|
2007-09-12 00:32:51 +02:00
|
|
|
: public _GLIBCXX_STD_D::vector<_Tp, _Allocator>,
|
2003-11-11 21:09:16 +01:00
|
|
|
public __gnu_debug::_Safe_sequence<vector<_Tp, _Allocator> >
|
|
|
|
{
|
2007-09-12 00:32:51 +02:00
|
|
|
typedef _GLIBCXX_STD_D::vector<_Tp, _Allocator> _Base;
|
2003-11-11 21:09:16 +01:00
|
|
|
typedef __gnu_debug::_Safe_sequence<vector> _Safe_base;
|
|
|
|
|
|
|
|
typedef typename _Base::const_iterator _Base_const_iterator;
|
|
|
|
typedef __gnu_debug::_After_nth_from<_Base_const_iterator> _After_nth;
|
|
|
|
|
|
|
|
public:
|
|
|
|
typedef typename _Base::reference reference;
|
|
|
|
typedef typename _Base::const_reference const_reference;
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,vector>
|
2003-11-11 21:09:16 +01:00
|
|
|
iterator;
|
|
|
|
typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,vector>
|
|
|
|
const_iterator;
|
|
|
|
|
|
|
|
typedef typename _Base::size_type size_type;
|
|
|
|
typedef typename _Base::difference_type difference_type;
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
typedef _Tp value_type;
|
|
|
|
typedef _Allocator allocator_type;
|
2005-06-07 04:23:44 +02:00
|
|
|
typedef typename _Base::pointer pointer;
|
|
|
|
typedef typename _Base::const_pointer const_pointer;
|
2003-11-11 21:09:16 +01:00
|
|
|
typedef std::reverse_iterator<iterator> reverse_iterator;
|
|
|
|
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
|
|
|
|
|
|
|
// 23.2.4.1 construct/copy/destroy:
|
|
|
|
explicit vector(const _Allocator& __a = _Allocator())
|
|
|
|
: _Base(__a), _M_guaranteed_capacity(0) { }
|
|
|
|
|
|
|
|
explicit vector(size_type __n, const _Tp& __value = _Tp(),
|
|
|
|
const _Allocator& __a = _Allocator())
|
|
|
|
: _Base(__n, __value, __a), _M_guaranteed_capacity(__n) { }
|
|
|
|
|
|
|
|
template<class _InputIterator>
|
|
|
|
vector(_InputIterator __first, _InputIterator __last,
|
|
|
|
const _Allocator& __a = _Allocator())
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
: _Base(__gnu_debug::__check_valid_range(__first, __last),
|
2003-11-11 21:09:16 +01:00
|
|
|
__last, __a),
|
|
|
|
_M_guaranteed_capacity(0)
|
|
|
|
{ _M_update_guaranteed_capacity(); }
|
|
|
|
|
list (list<>::list(list&&), [...]): Add.
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/debug/vector (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/debug/deque (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/debug/set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/debug/map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/debug/multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/debug/multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129071
2007-10-07 18:33:59 +02:00
|
|
|
vector(const vector& __x)
|
2003-11-11 21:09:16 +01:00
|
|
|
: _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
|
|
|
|
|
|
|
|
/// Construction from a release-mode vector
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
vector(const _Base& __x)
|
2003-11-11 21:09:16 +01:00
|
|
|
: _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
|
|
|
|
|
list (list<>::list(list&&), [...]): Add.
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/debug/vector (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/debug/deque (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/debug/set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/debug/map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/debug/multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/debug/multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129071
2007-10-07 18:33:59 +02:00
|
|
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
|
|
|
vector(vector&& __x)
|
2007-10-10 19:31:28 +02:00
|
|
|
: _Base(std::forward<vector>(__x)), _Safe_base(),
|
|
|
|
_M_guaranteed_capacity(this->size())
|
|
|
|
{
|
list (list<>::list(list&&), [...]): Add.
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/debug/vector (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/debug/deque (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/debug/set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/debug/map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/debug/multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/debug/multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129071
2007-10-07 18:33:59 +02:00
|
|
|
this->_M_swap(__x);
|
|
|
|
__x._M_guaranteed_capacity = 0;
|
|
|
|
}
|
2008-07-21 21:40:39 +02:00
|
|
|
|
|
|
|
vector(initializer_list<value_type> __l,
|
|
|
|
const allocator_type& __a = allocator_type())
|
2008-07-29 21:34:36 +02:00
|
|
|
: _Base(__l, __a), _Safe_base(),
|
|
|
|
_M_guaranteed_capacity(__l.size()) { }
|
list (list<>::list(list&&), [...]): Add.
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/debug/vector (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/debug/deque (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/debug/set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/debug/map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/debug/multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/debug/multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129071
2007-10-07 18:33:59 +02:00
|
|
|
#endif
|
|
|
|
|
2003-11-11 21:09:16 +01:00
|
|
|
~vector() { }
|
|
|
|
|
list (list<>::list(list&&), [...]): Add.
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/debug/vector (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/debug/deque (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/debug/set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/debug/map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/debug/multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/debug/multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129071
2007-10-07 18:33:59 +02:00
|
|
|
vector&
|
|
|
|
operator=(const vector& __x)
|
2003-11-11 21:09:16 +01:00
|
|
|
{
|
|
|
|
static_cast<_Base&>(*this) = __x;
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
list (list<>::list(list&&), [...]): Add.
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/debug/vector (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/debug/deque (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/debug/set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/debug/map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/debug/multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/debug/multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129071
2007-10-07 18:33:59 +02:00
|
|
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
|
|
|
vector&
|
|
|
|
operator=(vector&& __x)
|
|
|
|
{
|
2007-11-09 18:18:10 +01:00
|
|
|
// NB: DR 675.
|
|
|
|
clear();
|
list (list<>::list(list&&), [...]): Add.
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/debug/vector (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/debug/deque (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/debug/set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/debug/map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/debug/multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/debug/multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129071
2007-10-07 18:33:59 +02:00
|
|
|
swap(__x);
|
|
|
|
return *this;
|
|
|
|
}
|
2008-07-21 21:40:39 +02:00
|
|
|
|
|
|
|
vector&
|
|
|
|
operator=(initializer_list<value_type> __l)
|
|
|
|
{
|
|
|
|
static_cast<_Base&>(*this) = __l;
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
return *this;
|
|
|
|
}
|
list (list<>::list(list&&), [...]): Add.
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/debug/vector (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/debug/deque (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/debug/set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/debug/map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/debug/multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/debug/multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129071
2007-10-07 18:33:59 +02:00
|
|
|
#endif
|
|
|
|
|
2003-11-11 21:09:16 +01:00
|
|
|
template<typename _InputIterator>
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
void
|
2003-11-11 21:09:16 +01:00
|
|
|
assign(_InputIterator __first, _InputIterator __last)
|
|
|
|
{
|
|
|
|
__glibcxx_check_valid_range(__first, __last);
|
|
|
|
_Base::assign(__first, __last);
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
}
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
void
|
2003-11-11 21:09:16 +01:00
|
|
|
assign(size_type __n, const _Tp& __u)
|
|
|
|
{
|
|
|
|
_Base::assign(__n, __u);
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
}
|
|
|
|
|
2008-07-21 21:40:39 +02:00
|
|
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
|
|
|
void
|
|
|
|
assign(initializer_list<value_type> __l)
|
|
|
|
{
|
|
|
|
_Base::assign(__l);
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-11-11 21:09:16 +01:00
|
|
|
using _Base::get_allocator;
|
|
|
|
|
|
|
|
// iterators:
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
iterator
|
|
|
|
begin()
|
2003-11-11 21:09:16 +01:00
|
|
|
{ return iterator(_Base::begin(), this); }
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
const_iterator
|
|
|
|
begin() const
|
2003-11-11 21:09:16 +01:00
|
|
|
{ return const_iterator(_Base::begin(), this); }
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
iterator
|
2003-11-11 21:09:16 +01:00
|
|
|
end()
|
|
|
|
{ return iterator(_Base::end(), this); }
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
const_iterator
|
2003-11-11 21:09:16 +01:00
|
|
|
end() const
|
|
|
|
{ return const_iterator(_Base::end(), this); }
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
reverse_iterator
|
|
|
|
rbegin()
|
2003-11-11 21:09:16 +01:00
|
|
|
{ return reverse_iterator(end()); }
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
const_reverse_iterator
|
2003-11-11 21:09:16 +01:00
|
|
|
rbegin() const
|
|
|
|
{ return const_reverse_iterator(end()); }
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
reverse_iterator
|
|
|
|
rend()
|
2003-11-11 21:09:16 +01:00
|
|
|
{ return reverse_iterator(begin()); }
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
const_reverse_iterator
|
|
|
|
rend() const
|
2003-11-11 21:09:16 +01:00
|
|
|
{ return const_reverse_iterator(begin()); }
|
|
|
|
|
set.h (set<>::cbegin, [...]): Add.
2007-10-15 Paolo Carlini <pcarlini@suse.de>
* include/debug/set.h (set<>::cbegin, cend, crbegin, crend): Add.
* include/debug/multiset.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/vector (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/deque (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/list (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/debug/multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/array (array<>::cbegin, cend, crbegin, crend):
Likewise.
* include/ext/vstring.h (__versa_string<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_list.h (list<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_map.h (map<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_set.h (set<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multimap.h (multimap<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_vector.h (vector<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_deque.h (deque<>::cbegin, cend, crbegin, crend):
Likewise.
* include/bits/stl_multiset.h (multiset<>::cbegin, cend, crbegin,
crend): Likewise.
* include/bits/stl_bvector.h (vector<bool>::cbegin, cend, crbegin,
crend): Likewise.
* include/tr1_impl/hashtable (_Hashtable<>::cbegin, cend): Add.
* testsuite/ext/vstring/requirements/citerators.cc: Add.
* testsuite/23_containers/unordered_map/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/multimap/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/set/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multimap/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/unordered_set/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/vector/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/bool/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/deque/requirements/citerators.cc: Likewise.
* testsuite/23_containers/multiset/requirements/citerators.cc:
Likewise.
* testsuite/23_containers/list/requirements/citerators.cc: Likewise.
* testsuite/23_containers/unordered_multiset/requirements/
citerators.cc: Likewise.
* testsuite/23_containers/map/requirements/citerators.cc: Likewise.
* testsuite/23_containers/array/requirements/citerators.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error lines.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Likewise.
From-SVN: r129370
2007-10-15 22:51:53 +02:00
|
|
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
|
|
|
const_iterator
|
|
|
|
cbegin() const
|
|
|
|
{ return const_iterator(_Base::begin(), this); }
|
|
|
|
|
|
|
|
const_iterator
|
|
|
|
cend() const
|
|
|
|
{ return const_iterator(_Base::end(), this); }
|
|
|
|
|
|
|
|
const_reverse_iterator
|
|
|
|
crbegin() const
|
|
|
|
{ return const_reverse_iterator(end()); }
|
|
|
|
|
|
|
|
const_reverse_iterator
|
|
|
|
crend() const
|
|
|
|
{ return const_reverse_iterator(begin()); }
|
|
|
|
#endif
|
|
|
|
|
2003-11-11 21:09:16 +01:00
|
|
|
// 23.2.4.2 capacity:
|
|
|
|
using _Base::size;
|
|
|
|
using _Base::max_size;
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
void
|
2003-11-11 21:09:16 +01:00
|
|
|
resize(size_type __sz, _Tp __c = _Tp())
|
|
|
|
{
|
|
|
|
bool __realloc = _M_requires_reallocation(__sz);
|
|
|
|
if (__sz < this->size())
|
|
|
|
this->_M_invalidate_if(_After_nth(__sz, _M_base().begin()));
|
|
|
|
_Base::resize(__sz, __c);
|
|
|
|
if (__realloc)
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
}
|
|
|
|
|
2008-05-12 12:15:34 +02:00
|
|
|
size_type
|
|
|
|
capacity() const
|
|
|
|
{
|
|
|
|
#ifdef _GLIBCXX_DEBUG_PEDANTIC
|
|
|
|
return _M_guaranteed_capacity;
|
|
|
|
#else
|
|
|
|
return _Base::capacity();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2003-11-11 21:09:16 +01:00
|
|
|
using _Base::empty;
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
void
|
2003-11-11 21:09:16 +01:00
|
|
|
reserve(size_type __n)
|
|
|
|
{
|
|
|
|
bool __realloc = _M_requires_reallocation(__n);
|
|
|
|
_Base::reserve(__n);
|
|
|
|
if (__n > _M_guaranteed_capacity)
|
|
|
|
_M_guaranteed_capacity = __n;
|
|
|
|
if (__realloc)
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
}
|
|
|
|
|
|
|
|
// element access:
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
reference
|
2003-11-11 21:09:16 +01:00
|
|
|
operator[](size_type __n)
|
|
|
|
{
|
|
|
|
__glibcxx_check_subscript(__n);
|
|
|
|
return _M_base()[__n];
|
|
|
|
}
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
const_reference
|
2003-11-11 21:09:16 +01:00
|
|
|
operator[](size_type __n) const
|
|
|
|
{
|
|
|
|
__glibcxx_check_subscript(__n);
|
|
|
|
return _M_base()[__n];
|
|
|
|
}
|
|
|
|
|
|
|
|
using _Base::at;
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
reference
|
2003-11-11 21:09:16 +01:00
|
|
|
front()
|
|
|
|
{
|
|
|
|
__glibcxx_check_nonempty();
|
|
|
|
return _Base::front();
|
|
|
|
}
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
const_reference
|
2003-11-11 21:09:16 +01:00
|
|
|
front() const
|
|
|
|
{
|
|
|
|
__glibcxx_check_nonempty();
|
|
|
|
return _Base::front();
|
|
|
|
}
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
reference
|
2003-11-11 21:09:16 +01:00
|
|
|
back()
|
|
|
|
{
|
|
|
|
__glibcxx_check_nonempty();
|
|
|
|
return _Base::back();
|
|
|
|
}
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
const_reference
|
2003-11-11 21:09:16 +01:00
|
|
|
back() const
|
|
|
|
{
|
|
|
|
__glibcxx_check_nonempty();
|
|
|
|
return _Base::back();
|
|
|
|
}
|
|
|
|
|
2005-08-29 18:11:19 +02:00
|
|
|
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
|
|
|
// DR 464. Suggestion for new member functions in standard containers.
|
|
|
|
using _Base::data;
|
|
|
|
|
2003-11-11 21:09:16 +01:00
|
|
|
// 23.2.4.3 modifiers:
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
void
|
2003-11-11 21:09:16 +01:00
|
|
|
push_back(const _Tp& __x)
|
|
|
|
{
|
|
|
|
bool __realloc = _M_requires_reallocation(this->size() + 1);
|
|
|
|
_Base::push_back(__x);
|
|
|
|
if (__realloc)
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
}
|
stl_deque.h (deque<>::push_back(_Args&&...), [...]): Remove.
2008-06-13 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_deque.h (deque<>::push_back(_Args&&...),
deque<>::push_front(_Args&&...)): Remove.
(deque<>::push_back(value_type&&),
deque<>::push_front(value_type&&)): Add.
(deque<>::push_back(const value_type&),
deque<>::push_front(const value_type&)): Add back.
(deque<>::emplace_back(_Args&&...),
deque<>::emplace_front(_Args&&...)): Declare...
* include/bits/deque.tcc: ... and define.
* include/bits/stl_list.h (list<>::push_back(_Args&&...),
list<>::push_front(_Args&&...)): Remove.
(list<>::push_back(value_type&&), list<>::push_front(value_type&&),
list<>::emplace_back(_Args&&...), list<>::emplace_front(_Args&&...)):
Add.
(list<>::push_back(const value_type&),
list<>::push_front(const value_type&)): Add back.
* include/bits/stl_vector.h (vector<>::push_back(_Args&&...)): Remove.
(vector<>::push_back(value_type&&)): Add.
(vector<>::push_back(const value_type&)): Add back.
(vector<>::emplace_back(_Args&&...)): Declare...
* include/bits/vector.tcc: ... and define.
* include/bits/stl_queue.h (queue<>::push(_Args&&...),
priority_queue<>::push(_Args&&...)): Remove.
(queue<>::push(value_type&&), queue<>::emplace(_Args&&...),
priority_queue<>::push(value_type&&),
priority_queue<>::emplace(_Args&&...)): Add.
(queue<>::push(const value_type&),
priority_queue<>::push(const value_type&)): Add back.
* include/bits/stl_stack.h (stack<>::push(_Args&&...)): Remove.
(stack<>::push(value_type&&), stack<>::emplace(_Args&&...)): Add.
(stack<>::push(const value_type&)): Add back.
* include/debug/deque (deque<>::push_back(_Args&&...),
deque<>::push_front(_Args&&...)): Remove.
(deque<>::push_back(value_type&&), deque<>::push_front(value_type&&),
deque<>::emplace_back(_Args&&...), deque<>::emplace_front(_Args&&...)):
Add.
(deque<>::push_back(const value_type&),
deque<>::push_front(const value_type&)): Add back.
* include/debug/list (list<>::push_back(_Args&&...),
list<>::push_front(_Args&&...)): Remove.
(list<>::push_back(value_type&&), list<>::push_front(value_type&&),
list<>::emplace_back(_Args&&...), list<>::emplace_front(_Args&&...)):
Add.
(list<>::push_back(const value_type&),
list<>::push_front(const value_type&)): Add back.
* include/debug/vector (vector<>::push_back(_Args&&...)): Remove.
(vector<>::push_back(value_type&&),
vector<>::emplace_back(_Args&&...)): Add.
(vector<>::push_back(const value_type&)): Add back.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
From-SVN: r136750
2008-06-13 14:03:13 +02:00
|
|
|
|
|
|
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
2008-07-18 22:11:21 +02:00
|
|
|
template<typename _Up = _Tp>
|
|
|
|
typename __gnu_cxx::__enable_if<!std::__are_same<_Up, bool>::__value,
|
|
|
|
void>::__type
|
|
|
|
push_back(_Tp&& __x)
|
|
|
|
{ emplace_back(std::move(__x)); }
|
stl_deque.h (deque<>::push_back(_Args&&...), [...]): Remove.
2008-06-13 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_deque.h (deque<>::push_back(_Args&&...),
deque<>::push_front(_Args&&...)): Remove.
(deque<>::push_back(value_type&&),
deque<>::push_front(value_type&&)): Add.
(deque<>::push_back(const value_type&),
deque<>::push_front(const value_type&)): Add back.
(deque<>::emplace_back(_Args&&...),
deque<>::emplace_front(_Args&&...)): Declare...
* include/bits/deque.tcc: ... and define.
* include/bits/stl_list.h (list<>::push_back(_Args&&...),
list<>::push_front(_Args&&...)): Remove.
(list<>::push_back(value_type&&), list<>::push_front(value_type&&),
list<>::emplace_back(_Args&&...), list<>::emplace_front(_Args&&...)):
Add.
(list<>::push_back(const value_type&),
list<>::push_front(const value_type&)): Add back.
* include/bits/stl_vector.h (vector<>::push_back(_Args&&...)): Remove.
(vector<>::push_back(value_type&&)): Add.
(vector<>::push_back(const value_type&)): Add back.
(vector<>::emplace_back(_Args&&...)): Declare...
* include/bits/vector.tcc: ... and define.
* include/bits/stl_queue.h (queue<>::push(_Args&&...),
priority_queue<>::push(_Args&&...)): Remove.
(queue<>::push(value_type&&), queue<>::emplace(_Args&&...),
priority_queue<>::push(value_type&&),
priority_queue<>::emplace(_Args&&...)): Add.
(queue<>::push(const value_type&),
priority_queue<>::push(const value_type&)): Add back.
* include/bits/stl_stack.h (stack<>::push(_Args&&...)): Remove.
(stack<>::push(value_type&&), stack<>::emplace(_Args&&...)): Add.
(stack<>::push(const value_type&)): Add back.
* include/debug/deque (deque<>::push_back(_Args&&...),
deque<>::push_front(_Args&&...)): Remove.
(deque<>::push_back(value_type&&), deque<>::push_front(value_type&&),
deque<>::emplace_back(_Args&&...), deque<>::emplace_front(_Args&&...)):
Add.
(deque<>::push_back(const value_type&),
deque<>::push_front(const value_type&)): Add back.
* include/debug/list (list<>::push_back(_Args&&...),
list<>::push_front(_Args&&...)): Remove.
(list<>::push_back(value_type&&), list<>::push_front(value_type&&),
list<>::emplace_back(_Args&&...), list<>::emplace_front(_Args&&...)):
Add.
(list<>::push_back(const value_type&),
list<>::push_front(const value_type&)): Add back.
* include/debug/vector (vector<>::push_back(_Args&&...)): Remove.
(vector<>::push_back(value_type&&),
vector<>::emplace_back(_Args&&...)): Add.
(vector<>::push_back(const value_type&)): Add back.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
From-SVN: r136750
2008-06-13 14:03:13 +02:00
|
|
|
|
stl_vector.h (vector<>::push_back<>(_Args...), [...]): Add.
2007-11-05 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_vector.h (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&),
_M_insert_aux<>(iterator, _Args&&...)): Add.
* include/bits/vector.tcc (insert(iterator, value_type&&),
emplace<>(iterator, _Args...), _M_insert_aux<>(iterator, _Args&&...)):
Define.
(_M_fill_insert(iterator, size_type, const value_type&),
_M_range_insert(iterator, _ForwardIterator, _ForwardIterator,
std::forward_iterator_tag)): Use __uninitialized_move_a,
_GLIBCXX_MOVE_BACKWARD3 when possible.
* include/bits/stl_uninitialized.h (__uninitialized_move_a): Add.
* include/debug/vector (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add.
* testsuite/23_containers/vector/modifiers/moveable.cc: Enable.
* testsuite/23_containers/vector/resize/moveable.cc: Likewise.
* testsuite/23_containers/vector/cons/moveable.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.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129907
2007-11-05 20:46:07 +01:00
|
|
|
template<typename... _Args>
|
|
|
|
void
|
stl_deque.h (deque<>::push_back(_Args&&...), [...]): Remove.
2008-06-13 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_deque.h (deque<>::push_back(_Args&&...),
deque<>::push_front(_Args&&...)): Remove.
(deque<>::push_back(value_type&&),
deque<>::push_front(value_type&&)): Add.
(deque<>::push_back(const value_type&),
deque<>::push_front(const value_type&)): Add back.
(deque<>::emplace_back(_Args&&...),
deque<>::emplace_front(_Args&&...)): Declare...
* include/bits/deque.tcc: ... and define.
* include/bits/stl_list.h (list<>::push_back(_Args&&...),
list<>::push_front(_Args&&...)): Remove.
(list<>::push_back(value_type&&), list<>::push_front(value_type&&),
list<>::emplace_back(_Args&&...), list<>::emplace_front(_Args&&...)):
Add.
(list<>::push_back(const value_type&),
list<>::push_front(const value_type&)): Add back.
* include/bits/stl_vector.h (vector<>::push_back(_Args&&...)): Remove.
(vector<>::push_back(value_type&&)): Add.
(vector<>::push_back(const value_type&)): Add back.
(vector<>::emplace_back(_Args&&...)): Declare...
* include/bits/vector.tcc: ... and define.
* include/bits/stl_queue.h (queue<>::push(_Args&&...),
priority_queue<>::push(_Args&&...)): Remove.
(queue<>::push(value_type&&), queue<>::emplace(_Args&&...),
priority_queue<>::push(value_type&&),
priority_queue<>::emplace(_Args&&...)): Add.
(queue<>::push(const value_type&),
priority_queue<>::push(const value_type&)): Add back.
* include/bits/stl_stack.h (stack<>::push(_Args&&...)): Remove.
(stack<>::push(value_type&&), stack<>::emplace(_Args&&...)): Add.
(stack<>::push(const value_type&)): Add back.
* include/debug/deque (deque<>::push_back(_Args&&...),
deque<>::push_front(_Args&&...)): Remove.
(deque<>::push_back(value_type&&), deque<>::push_front(value_type&&),
deque<>::emplace_back(_Args&&...), deque<>::emplace_front(_Args&&...)):
Add.
(deque<>::push_back(const value_type&),
deque<>::push_front(const value_type&)): Add back.
* include/debug/list (list<>::push_back(_Args&&...),
list<>::push_front(_Args&&...)): Remove.
(list<>::push_back(value_type&&), list<>::push_front(value_type&&),
list<>::emplace_back(_Args&&...), list<>::emplace_front(_Args&&...)):
Add.
(list<>::push_back(const value_type&),
list<>::push_front(const value_type&)): Add back.
* include/debug/vector (vector<>::push_back(_Args&&...)): Remove.
(vector<>::push_back(value_type&&),
vector<>::emplace_back(_Args&&...)): Add.
(vector<>::push_back(const value_type&)): Add back.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
From-SVN: r136750
2008-06-13 14:03:13 +02:00
|
|
|
emplace_back(_Args&&... __args)
|
stl_vector.h (vector<>::push_back<>(_Args...), [...]): Add.
2007-11-05 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_vector.h (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&),
_M_insert_aux<>(iterator, _Args&&...)): Add.
* include/bits/vector.tcc (insert(iterator, value_type&&),
emplace<>(iterator, _Args...), _M_insert_aux<>(iterator, _Args&&...)):
Define.
(_M_fill_insert(iterator, size_type, const value_type&),
_M_range_insert(iterator, _ForwardIterator, _ForwardIterator,
std::forward_iterator_tag)): Use __uninitialized_move_a,
_GLIBCXX_MOVE_BACKWARD3 when possible.
* include/bits/stl_uninitialized.h (__uninitialized_move_a): Add.
* include/debug/vector (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add.
* testsuite/23_containers/vector/modifiers/moveable.cc: Enable.
* testsuite/23_containers/vector/resize/moveable.cc: Likewise.
* testsuite/23_containers/vector/cons/moveable.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.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129907
2007-11-05 20:46:07 +01:00
|
|
|
{
|
|
|
|
bool __realloc = _M_requires_reallocation(this->size() + 1);
|
stl_deque.h (deque<>::push_back(_Args&&...), [...]): Remove.
2008-06-13 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_deque.h (deque<>::push_back(_Args&&...),
deque<>::push_front(_Args&&...)): Remove.
(deque<>::push_back(value_type&&),
deque<>::push_front(value_type&&)): Add.
(deque<>::push_back(const value_type&),
deque<>::push_front(const value_type&)): Add back.
(deque<>::emplace_back(_Args&&...),
deque<>::emplace_front(_Args&&...)): Declare...
* include/bits/deque.tcc: ... and define.
* include/bits/stl_list.h (list<>::push_back(_Args&&...),
list<>::push_front(_Args&&...)): Remove.
(list<>::push_back(value_type&&), list<>::push_front(value_type&&),
list<>::emplace_back(_Args&&...), list<>::emplace_front(_Args&&...)):
Add.
(list<>::push_back(const value_type&),
list<>::push_front(const value_type&)): Add back.
* include/bits/stl_vector.h (vector<>::push_back(_Args&&...)): Remove.
(vector<>::push_back(value_type&&)): Add.
(vector<>::push_back(const value_type&)): Add back.
(vector<>::emplace_back(_Args&&...)): Declare...
* include/bits/vector.tcc: ... and define.
* include/bits/stl_queue.h (queue<>::push(_Args&&...),
priority_queue<>::push(_Args&&...)): Remove.
(queue<>::push(value_type&&), queue<>::emplace(_Args&&...),
priority_queue<>::push(value_type&&),
priority_queue<>::emplace(_Args&&...)): Add.
(queue<>::push(const value_type&),
priority_queue<>::push(const value_type&)): Add back.
* include/bits/stl_stack.h (stack<>::push(_Args&&...)): Remove.
(stack<>::push(value_type&&), stack<>::emplace(_Args&&...)): Add.
(stack<>::push(const value_type&)): Add back.
* include/debug/deque (deque<>::push_back(_Args&&...),
deque<>::push_front(_Args&&...)): Remove.
(deque<>::push_back(value_type&&), deque<>::push_front(value_type&&),
deque<>::emplace_back(_Args&&...), deque<>::emplace_front(_Args&&...)):
Add.
(deque<>::push_back(const value_type&),
deque<>::push_front(const value_type&)): Add back.
* include/debug/list (list<>::push_back(_Args&&...),
list<>::push_front(_Args&&...)): Remove.
(list<>::push_back(value_type&&), list<>::push_front(value_type&&),
list<>::emplace_back(_Args&&...), list<>::emplace_front(_Args&&...)):
Add.
(list<>::push_back(const value_type&),
list<>::push_front(const value_type&)): Add back.
* include/debug/vector (vector<>::push_back(_Args&&...)): Remove.
(vector<>::push_back(value_type&&),
vector<>::emplace_back(_Args&&...)): Add.
(vector<>::push_back(const value_type&)): Add back.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
From-SVN: r136750
2008-06-13 14:03:13 +02:00
|
|
|
_Base::emplace_back(std::forward<_Args>(__args)...);
|
stl_vector.h (vector<>::push_back<>(_Args...), [...]): Add.
2007-11-05 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_vector.h (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&),
_M_insert_aux<>(iterator, _Args&&...)): Add.
* include/bits/vector.tcc (insert(iterator, value_type&&),
emplace<>(iterator, _Args...), _M_insert_aux<>(iterator, _Args&&...)):
Define.
(_M_fill_insert(iterator, size_type, const value_type&),
_M_range_insert(iterator, _ForwardIterator, _ForwardIterator,
std::forward_iterator_tag)): Use __uninitialized_move_a,
_GLIBCXX_MOVE_BACKWARD3 when possible.
* include/bits/stl_uninitialized.h (__uninitialized_move_a): Add.
* include/debug/vector (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add.
* testsuite/23_containers/vector/modifiers/moveable.cc: Enable.
* testsuite/23_containers/vector/resize/moveable.cc: Likewise.
* testsuite/23_containers/vector/cons/moveable.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.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129907
2007-11-05 20:46:07 +01:00
|
|
|
if (__realloc)
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
}
|
|
|
|
#endif
|
2003-11-11 21:09:16 +01:00
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
void
|
2003-11-11 21:09:16 +01:00
|
|
|
pop_back()
|
|
|
|
{
|
|
|
|
__glibcxx_check_nonempty();
|
|
|
|
iterator __victim = end() - 1;
|
|
|
|
__victim._M_invalidate();
|
|
|
|
_Base::pop_back();
|
|
|
|
}
|
|
|
|
|
stl_vector.h (vector<>::push_back<>(_Args...), [...]): Add.
2007-11-05 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_vector.h (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&),
_M_insert_aux<>(iterator, _Args&&...)): Add.
* include/bits/vector.tcc (insert(iterator, value_type&&),
emplace<>(iterator, _Args...), _M_insert_aux<>(iterator, _Args&&...)):
Define.
(_M_fill_insert(iterator, size_type, const value_type&),
_M_range_insert(iterator, _ForwardIterator, _ForwardIterator,
std::forward_iterator_tag)): Use __uninitialized_move_a,
_GLIBCXX_MOVE_BACKWARD3 when possible.
* include/bits/stl_uninitialized.h (__uninitialized_move_a): Add.
* include/debug/vector (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add.
* testsuite/23_containers/vector/modifiers/moveable.cc: Enable.
* testsuite/23_containers/vector/resize/moveable.cc: Likewise.
* testsuite/23_containers/vector/cons/moveable.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.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129907
2007-11-05 20:46:07 +01:00
|
|
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
|
|
|
template<typename... _Args>
|
|
|
|
iterator
|
2007-11-08 12:11:47 +01:00
|
|
|
emplace(iterator __position, _Args&&... __args)
|
stl_vector.h (vector<>::push_back<>(_Args...), [...]): Add.
2007-11-05 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_vector.h (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&),
_M_insert_aux<>(iterator, _Args&&...)): Add.
* include/bits/vector.tcc (insert(iterator, value_type&&),
emplace<>(iterator, _Args...), _M_insert_aux<>(iterator, _Args&&...)):
Define.
(_M_fill_insert(iterator, size_type, const value_type&),
_M_range_insert(iterator, _ForwardIterator, _ForwardIterator,
std::forward_iterator_tag)): Use __uninitialized_move_a,
_GLIBCXX_MOVE_BACKWARD3 when possible.
* include/bits/stl_uninitialized.h (__uninitialized_move_a): Add.
* include/debug/vector (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add.
* testsuite/23_containers/vector/modifiers/moveable.cc: Enable.
* testsuite/23_containers/vector/resize/moveable.cc: Likewise.
* testsuite/23_containers/vector/cons/moveable.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.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129907
2007-11-05 20:46:07 +01:00
|
|
|
{
|
|
|
|
__glibcxx_check_insert(__position);
|
|
|
|
bool __realloc = _M_requires_reallocation(this->size() + 1);
|
|
|
|
difference_type __offset = __position - begin();
|
|
|
|
typename _Base::iterator __res = _Base::emplace(__position.base(),
|
|
|
|
std::forward<_Args>(__args)...);
|
|
|
|
if (__realloc)
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
else
|
|
|
|
this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
return iterator(__res, this);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
iterator
|
2003-11-11 21:09:16 +01:00
|
|
|
insert(iterator __position, const _Tp& __x)
|
|
|
|
{
|
|
|
|
__glibcxx_check_insert(__position);
|
|
|
|
bool __realloc = _M_requires_reallocation(this->size() + 1);
|
|
|
|
difference_type __offset = __position - begin();
|
|
|
|
typename _Base::iterator __res = _Base::insert(__position.base(),__x);
|
|
|
|
if (__realloc)
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
else
|
|
|
|
this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
return iterator(__res, this);
|
|
|
|
}
|
|
|
|
|
stl_vector.h (vector<>::push_back<>(_Args...), [...]): Add.
2007-11-05 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_vector.h (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&),
_M_insert_aux<>(iterator, _Args&&...)): Add.
* include/bits/vector.tcc (insert(iterator, value_type&&),
emplace<>(iterator, _Args...), _M_insert_aux<>(iterator, _Args&&...)):
Define.
(_M_fill_insert(iterator, size_type, const value_type&),
_M_range_insert(iterator, _ForwardIterator, _ForwardIterator,
std::forward_iterator_tag)): Use __uninitialized_move_a,
_GLIBCXX_MOVE_BACKWARD3 when possible.
* include/bits/stl_uninitialized.h (__uninitialized_move_a): Add.
* include/debug/vector (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add.
* testsuite/23_containers/vector/modifiers/moveable.cc: Enable.
* testsuite/23_containers/vector/resize/moveable.cc: Likewise.
* testsuite/23_containers/vector/cons/moveable.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.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129907
2007-11-05 20:46:07 +01:00
|
|
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
2008-07-18 22:11:21 +02:00
|
|
|
template<typename _Up = _Tp>
|
|
|
|
typename __gnu_cxx::__enable_if<!std::__are_same<_Up, bool>::__value,
|
|
|
|
iterator>::__type
|
|
|
|
insert(iterator __position, _Tp&& __x)
|
|
|
|
{ return emplace(__position, std::move(__x)); }
|
2008-07-21 21:40:39 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
insert(iterator __position, initializer_list<value_type> __l)
|
|
|
|
{ this->insert(__position, __l.begin(), __l.end()); }
|
stl_vector.h (vector<>::push_back<>(_Args...), [...]): Add.
2007-11-05 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_vector.h (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&),
_M_insert_aux<>(iterator, _Args&&...)): Add.
* include/bits/vector.tcc (insert(iterator, value_type&&),
emplace<>(iterator, _Args...), _M_insert_aux<>(iterator, _Args&&...)):
Define.
(_M_fill_insert(iterator, size_type, const value_type&),
_M_range_insert(iterator, _ForwardIterator, _ForwardIterator,
std::forward_iterator_tag)): Use __uninitialized_move_a,
_GLIBCXX_MOVE_BACKWARD3 when possible.
* include/bits/stl_uninitialized.h (__uninitialized_move_a): Add.
* include/debug/vector (vector<>::push_back<>(_Args...),
emplace<>(iterator, _Args...), insert(iterator, _Tp&&)): Add.
* testsuite/23_containers/vector/modifiers/moveable.cc: Enable.
* testsuite/23_containers/vector/resize/moveable.cc: Likewise.
* testsuite/23_containers/vector/cons/moveable.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.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129907
2007-11-05 20:46:07 +01:00
|
|
|
#endif
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
void
|
2003-11-11 21:09:16 +01:00
|
|
|
insert(iterator __position, size_type __n, const _Tp& __x)
|
|
|
|
{
|
|
|
|
__glibcxx_check_insert(__position);
|
|
|
|
bool __realloc = _M_requires_reallocation(this->size() + __n);
|
|
|
|
difference_type __offset = __position - begin();
|
|
|
|
_Base::insert(__position.base(), __n, __x);
|
|
|
|
if (__realloc)
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
else
|
|
|
|
this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
}
|
|
|
|
|
|
|
|
template<class _InputIterator>
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
void
|
|
|
|
insert(iterator __position,
|
2003-11-11 21:09:16 +01:00
|
|
|
_InputIterator __first, _InputIterator __last)
|
|
|
|
{
|
|
|
|
__glibcxx_check_insert_range(__position, __first, __last);
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
|
2003-11-11 21:09:16 +01:00
|
|
|
/* Hard to guess if invalidation will occur, because __last
|
|
|
|
- __first can't be calculated in all cases, so we just
|
|
|
|
punt here by checking if it did occur. */
|
|
|
|
typename _Base::iterator __old_begin = _M_base().begin();
|
|
|
|
difference_type __offset = __position - begin();
|
|
|
|
_Base::insert(__position.base(), __first, __last);
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
|
2003-11-11 21:09:16 +01:00
|
|
|
if (_M_base().begin() != __old_begin)
|
|
|
|
this->_M_invalidate_all();
|
|
|
|
else
|
|
|
|
this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
|
|
|
|
_M_update_guaranteed_capacity();
|
|
|
|
}
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
|
|
|
|
iterator
|
2003-11-11 21:09:16 +01:00
|
|
|
erase(iterator __position)
|
|
|
|
{
|
|
|
|
__glibcxx_check_erase(__position);
|
|
|
|
difference_type __offset = __position - begin();
|
|
|
|
typename _Base::iterator __res = _Base::erase(__position.base());
|
|
|
|
this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
|
|
|
|
return iterator(__res, this);
|
|
|
|
}
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
iterator
|
2003-11-11 21:09:16 +01:00
|
|
|
erase(iterator __first, iterator __last)
|
|
|
|
{
|
|
|
|
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
|
|
|
// 151. can't currently clear() empty container
|
|
|
|
__glibcxx_check_erase_range(__first, __last);
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
|
2003-11-11 21:09:16 +01:00
|
|
|
difference_type __offset = __first - begin();
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
typename _Base::iterator __res = _Base::erase(__first.base(),
|
2003-11-11 21:09:16 +01:00
|
|
|
__last.base());
|
|
|
|
this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
|
|
|
|
return iterator(__res, this);
|
|
|
|
}
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
void
|
list (list<>::list(list&&), [...]): Add.
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/debug/vector (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/debug/deque (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/debug/set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/debug/map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/debug/multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/debug/multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129071
2007-10-07 18:33:59 +02:00
|
|
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
|
|
|
swap(vector&& __x)
|
|
|
|
#else
|
|
|
|
swap(vector& __x)
|
|
|
|
#endif
|
2003-11-11 21:09:16 +01:00
|
|
|
{
|
|
|
|
_Base::swap(__x);
|
|
|
|
this->_M_swap(__x);
|
2003-11-14 01:15:00 +01:00
|
|
|
std::swap(_M_guaranteed_capacity, __x._M_guaranteed_capacity);
|
2003-11-11 21:09:16 +01:00
|
|
|
}
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
void
|
2003-11-11 21:09:16 +01:00
|
|
|
clear()
|
|
|
|
{
|
|
|
|
_Base::clear();
|
|
|
|
this->_M_invalidate_all();
|
2003-11-14 01:15:00 +01:00
|
|
|
_M_guaranteed_capacity = 0;
|
2003-11-11 21:09:16 +01:00
|
|
|
}
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
_Base&
|
2003-11-11 21:09:16 +01:00
|
|
|
_M_base() { return *this; }
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
const _Base&
|
2003-11-11 21:09:16 +01:00
|
|
|
_M_base() const { return *this; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
size_type _M_guaranteed_capacity;
|
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
bool
|
2003-11-11 21:09:16 +01:00
|
|
|
_M_requires_reallocation(size_type __elements)
|
2008-05-12 12:15:34 +02:00
|
|
|
{ return __elements > this->capacity(); }
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
|
|
|
|
void
|
2003-11-11 21:09:16 +01:00
|
|
|
_M_update_guaranteed_capacity()
|
|
|
|
{
|
|
|
|
if (this->size() > _M_guaranteed_capacity)
|
|
|
|
_M_guaranteed_capacity = this->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
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
operator!=(const vector<_Tp, _Alloc>& __lhs,
|
2003-11-11 21:09:16 +01:00
|
|
|
const vector<_Tp, _Alloc>& __rhs)
|
|
|
|
{ return __lhs._M_base() != __rhs._M_base(); }
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline bool
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
operator<(const vector<_Tp, _Alloc>& __lhs,
|
2003-11-11 21:09:16 +01:00
|
|
|
const vector<_Tp, _Alloc>& __rhs)
|
|
|
|
{ return __lhs._M_base() < __rhs._M_base(); }
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline bool
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
operator<=(const vector<_Tp, _Alloc>& __lhs,
|
2003-11-11 21:09:16 +01:00
|
|
|
const vector<_Tp, _Alloc>& __rhs)
|
|
|
|
{ return __lhs._M_base() <= __rhs._M_base(); }
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline bool
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
operator>=(const vector<_Tp, _Alloc>& __lhs,
|
2003-11-11 21:09:16 +01:00
|
|
|
const vector<_Tp, _Alloc>& __rhs)
|
|
|
|
{ return __lhs._M_base() >= __rhs._M_base(); }
|
|
|
|
|
|
|
|
template<typename _Tp, typename _Alloc>
|
|
|
|
inline bool
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
operator>(const vector<_Tp, _Alloc>& __lhs,
|
2003-11-11 21:09:16 +01:00
|
|
|
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); }
|
list (list<>::list(list&&), [...]): Add.
2007-10-07 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
* include/debug/list (list<>::list(list&&),
list<>::operator=(list&&)): Add.
(list<>::swap): Adjust.
(swap(list&&, list& __y), swap(list&, list&& __y)): Add.
* include/debug/vector (vector<>::vector(vector&&),
vector<>::operator=(vector&&)): Add.
(vector<>::swap): Adjust.
(swap(vector&&, vector& __y), swap(vector&, vector&& __y)): Add.
* include/debug/deque (deque<>::deque(deque&&),
deque<>::operator=(deque&&)): Add.
(deque<>::swap): Adjust.
(swap(deque&&, deque& __y), swap(deque&, deque&& __y)): Add.
* include/debug/set.h (set<>::set(set&&),
set<>::operator=(set&&)): Add.
(set<>::swap): Adjust.
(swap(set&&, set& __y), swap(set&, set&& __y)): Add.
* include/debug/map.h (map<>::map(map&&),
map<>::operator=(map&&)): Add.
(map<>::swap): Adjust.
(swap(map&&, map& __y), swap(map&, map&& __y)): Add.
* include/debug/multiset.h (multiset<>::multiset(multiset&&),
multiset<>::operator=(multiset&&)): Add.
(smultiet<>::swap): Adjust.
(swap(multiset&&, multiset& __y),
swap(multiset&, multiset&& __y)): Add.
* include/debug/multimap.h (multimap<>::multimap(multimap&&),
multimap<>::operator=(multimap&&)): Add.
(multimap<>::swap): Adjust.
(swap(multimap&&, multimap& __y),
swap(multimap&, multimap&& __y)): Add.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r129071
2007-10-07 18:33:59 +02:00
|
|
|
|
|
|
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
|
|
|
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
|
|
|
|
|
2006-02-22 01:57:24 +01:00
|
|
|
} // namespace __debug
|
2005-12-19 01:56:05 +01:00
|
|
|
} // namespace std
|
2003-11-11 21:09:16 +01:00
|
|
|
|
bitset, [...]: Remove trailing whitespace.
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
include/debug/map.h, include/debug/multimap.h,
include/debug/multiset.h, include/debug/safe_base.h,
include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
include/debug/safe_sequence.h, include/debug/set.h,
include/debug/string, include/debug/vector: Remove trailing whitespace.
From-SVN: r74463
2003-12-09 05:26:28 +01:00
|
|
|
#endif
|