stl_list.h (insert(iterator, value_type&&)): Just forward to emplace.

2007-11-23  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/stl_list.h (insert(iterator, value_type&&)): Just
	forward to emplace.
	* include/bits/stl_vector.h (insert(iterator, value_type&&)): Likewise.
	* include/bits/stl_deque.h (insert(iterator, value_type&&)): Likewise.
	* include/debug/list (insert(iterator, value_type&&)): Likewise.
	* include/debug/vector (insert(iterator, value_type&&)): Likewise.
	* include/debug/deque (insert(iterator, value_type&&)): Likewise.
	* include/bits/list.tcc (insert(iterator, value_type&&)): Remove.
	* include/bits/vector.tcc (insert(iterator, value_type&&)): Likewise.
	* include/bits/deque.tcc (insert(iterator, value_type&&)): Likewise.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
	Adjust dg-error line number.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
	Adjust dg-error line number.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Adjust dg-error line number.
	* 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: r130374
This commit is contained in:
Paolo Carlini 2007-11-23 11:49:07 +00:00 committed by Paolo Carlini
parent 5102fac5fe
commit 360b7bffb1
22 changed files with 58 additions and 92 deletions

View File

@ -1,3 +1,40 @@
2007-11-23 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_list.h (insert(iterator, value_type&&)): Just
forward to emplace.
* include/bits/stl_vector.h (insert(iterator, value_type&&)): Likewise.
* include/bits/stl_deque.h (insert(iterator, value_type&&)): Likewise.
* include/debug/list (insert(iterator, value_type&&)): Likewise.
* include/debug/vector (insert(iterator, value_type&&)): Likewise.
* include/debug/deque (insert(iterator, value_type&&)): Likewise.
* include/bits/list.tcc (insert(iterator, value_type&&)): Remove.
* include/bits/vector.tcc (insert(iterator, value_type&&)): Likewise.
* include/bits/deque.tcc (insert(iterator, value_type&&)): Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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.
2007-11-22 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree_impl<, true>): Remove,

View File

@ -107,27 +107,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
}
#ifdef __GXX_EXPERIMENTAL_CXX0X__
template<typename _Tp, typename _Alloc>
typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>::
insert(iterator __position, value_type&& __x)
{
if (__position._M_cur == this->_M_impl._M_start._M_cur)
{
push_front(std::move(__x));
return this->_M_impl._M_start;
}
else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
{
push_back(std::move(__x));
iterator __tmp = this->_M_impl._M_finish;
--__tmp;
return __tmp;
}
else
return _M_insert_aux(__position, std::move(__x));
}
template<typename _Tp, typename _Alloc>
template<typename... _Args>
typename deque<_Tp, _Alloc>::iterator

View File

@ -103,18 +103,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
return iterator(__tmp);
}
#ifdef __GXX_EXPERIMENTAL_CXX0X__
template<typename _Tp, typename _Alloc>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::
insert(iterator __position, value_type&& __x)
{
_Node* __tmp = _M_create_node(std::move(__x));
__tmp->hook(__position._M_node);
return iterator(__tmp);
}
#endif
template<typename _Tp, typename _Alloc>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::

View File

@ -1276,7 +1276,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* specified location.
*/
iterator
insert(iterator __position, value_type&& __x);
insert(iterator __position, value_type&& __x)
{ return emplace(__position, std::move(__x)); }
#endif
/**

View File

@ -951,7 +951,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* invalidate iterators and references.
*/
iterator
insert(iterator __position, value_type&& __x);
insert(iterator __position, value_type&& __x)
{ return emplace(__position, std::move(__x)); }
#endif
/**

View File

@ -774,7 +774,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* used the user should consider using std::list.
*/
iterator
insert(iterator __position, value_type&& __x);
insert(iterator __position, value_type&& __x)
{ return emplace(__position, std::move(__x)); }
#endif
/**

View File

@ -115,25 +115,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
return iterator(this->_M_impl._M_start + __n);
}
#ifdef __GXX_EXPERIMENTAL_CXX0X__
template<typename _Tp, typename _Alloc>
typename vector<_Tp, _Alloc>::iterator
vector<_Tp, _Alloc>::
insert(iterator __position, value_type&& __x)
{
const size_type __n = __position - begin();
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
&& __position == end())
{
this->_M_impl.construct(this->_M_impl._M_finish, std::move(__x));
++this->_M_impl._M_finish;
}
else
_M_insert_aux(__position, std::move(__x));
return iterator(this->_M_impl._M_start + __n);
}
#endif
template<typename _Tp, typename _Alloc>
typename vector<_Tp, _Alloc>::iterator
vector<_Tp, _Alloc>::

View File

@ -309,13 +309,7 @@ namespace __debug
#ifdef __GXX_EXPERIMENTAL_CXX0X__
iterator
insert(iterator __position, _Tp&& __x)
{
__glibcxx_check_insert(__position);
typename _Base::iterator __res = _Base::insert(__position.base(),
std::move(__x));
this->_M_invalidate_all();
return iterator(__res, this);
}
{ return emplace(__position, std::move(__x)); }
#endif
void

View File

@ -322,11 +322,7 @@ namespace __debug
#ifdef __GXX_EXPERIMENTAL_CXX0X__
iterator
insert(iterator __position, _Tp&& __x)
{
__glibcxx_check_insert(__position);
return iterator(_Base::insert(__position.base(),
std::move(__x)), this);
}
{ return emplace(__position, std::move(__x)); }
#endif
void

View File

@ -349,19 +349,7 @@ namespace __debug
#ifdef __GXX_EXPERIMENTAL_CXX0X__
iterator
insert(iterator __position, _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(),
std::move(__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);
}
{ return emplace(__position, std::move(__x)); }
#endif
void

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1464 }
// { dg-error "no matching" "" { target *-*-* } 1465 }
// { dg-excess-errors "" }
#include <deque>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1399 }
// { dg-error "no matching" "" { target *-*-* } 1400 }
// { dg-excess-errors "" }
#include <deque>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1399 }
// { dg-error "no matching" "" { target *-*-* } 1400 }
// { dg-excess-errors "" }
#include <deque>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1552 }
// { dg-error "no matching" "" { target *-*-* } 1553 }
// { dg-excess-errors "" }
#include <deque>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1326 }
// { dg-error "no matching" "" { target *-*-* } 1327 }
// { dg-excess-errors "" }
#include <list>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1295 }
// { dg-error "no matching" "" { target *-*-* } 1296 }
// { dg-excess-errors "" }
#include <list>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1295 }
// { dg-error "no matching" "" { target *-*-* } 1296 }
// { dg-excess-errors "" }
#include <list>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1295 }
// { dg-error "no matching" "" { target *-*-* } 1296 }
// { dg-excess-errors "" }
#include <list>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 997 }
// { dg-error "no matching" "" { target *-*-* } 998 }
// { dg-excess-errors "" }
#include <vector>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 937 }
// { dg-error "no matching" "" { target *-*-* } 938 }
// { dg-excess-errors "" }
#include <vector>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 937 }
// { dg-error "no matching" "" { target *-*-* } 938 }
// { dg-excess-errors "" }
#include <vector>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1038 }
// { dg-error "no matching" "" { target *-*-* } 1039 }
// { dg-excess-errors "" }
#include <vector>