aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2008-06-13 12:03:13 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-06-13 12:03:13 +0000
commit4dc3e453c81f50fd3fac74ae85a7b7752cf58924 (patch)
tree493ca684950ee53a5812faa7bc131c613ff0d358
parentca789c7ff656bb004bd6693a1274a79b124af40f (diff)
downloadgcc-4dc3e453c81f50fd3fac74ae85a7b7752cf58924.zip
gcc-4dc3e453c81f50fd3fac74ae85a7b7752cf58924.tar.gz
gcc-4dc3e453c81f50fd3fac74ae85a7b7752cf58924.tar.bz2
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
-rw-r--r--libstdc++-v3/ChangeLog76
-rw-r--r--libstdc++-v3/include/bits/deque.tcc37
-rw-r--r--libstdc++-v3/include/bits/stl_deque.h41
-rw-r--r--libstdc++-v3/include/bits/stl_list.h24
-rw-r--r--libstdc++-v3/include/bits/stl_queue.h33
-rw-r--r--libstdc++-v3/include/bits/stl_stack.h15
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h20
-rw-r--r--libstdc++-v3/include/bits/vector.tcc18
-rw-r--r--libstdc++-v3/include/debug/deque22
-rw-r--r--libstdc++-v3/include/debug/list8
-rw-r--r--libstdc++-v3/include/debug/vector12
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc4
23 files changed, 242 insertions, 92 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 2d1681c..ebfca51 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,81 @@
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.
+
+2008-06-13 Paolo Carlini <paolo.carlini@oracle.com>
+
* include/tr1_impl/array (array<>::assign): Do not define in
C++0x mode, per DR 776...
(array<>::fill): ... define instead.
diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc
index 08b7ade..9c1096f 100644
--- a/libstdc++-v3/include/bits/deque.tcc
+++ b/libstdc++-v3/include/bits/deque.tcc
@@ -1,6 +1,6 @@
// Deque implementation (out of line) -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -85,6 +85,41 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
return *this;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ deque<_Tp, _Alloc>::
+ emplace_front(_Args&&... __args)
+ {
+ if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
+ {
+ this->_M_impl.construct(this->_M_impl._M_start._M_cur - 1,
+ std::forward<_Args>(__args)...);
+ --this->_M_impl._M_start._M_cur;
+ }
+ else
+ _M_push_front_aux(std::forward<_Args>(__args)...);
+ }
+
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ deque<_Tp, _Alloc>::
+ emplace_back(_Args&&... __args)
+ {
+ if (this->_M_impl._M_finish._M_cur
+ != this->_M_impl._M_finish._M_last - 1)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish._M_cur,
+ std::forward<_Args>(__args)...);
+ ++this->_M_impl._M_finish._M_cur;
+ }
+ else
+ _M_push_back_aux(std::forward<_Args>(__args)...);
+ }
+#endif
+
template <typename _Tp, typename _Alloc>
typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>::
diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h
index 6032765..b778f15 100644
--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -1117,7 +1117,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* data to it. Due to the nature of a %deque this operation
* can be done in constant time.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push_front(const value_type& __x)
{
@@ -1129,20 +1128,15 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
else
_M_push_front_aux(__x);
}
-#else
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_front(value_type&& __x)
+ { emplace_front(std::move(__x)); }
+
template<typename... _Args>
void
- push_front(_Args&&... __args)
- {
- if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first)
- {
- this->_M_impl.construct(this->_M_impl._M_start._M_cur - 1,
- std::forward<_Args>(__args)...);
- --this->_M_impl._M_start._M_cur;
- }
- else
- _M_push_front_aux(std::forward<_Args>(__args)...);
- }
+ emplace_front(_Args&&... __args);
#endif
/**
@@ -1154,7 +1148,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* to it. Due to the nature of a %deque this operation can be
* done in constant time.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push_back(const value_type& __x)
{
@@ -1167,21 +1160,15 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
else
_M_push_back_aux(__x);
}
-#else
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_back(value_type&& __x)
+ { emplace_back(std::move(__x)); }
+
template<typename... _Args>
void
- push_back(_Args&&... __args)
- {
- if (this->_M_impl._M_finish._M_cur
- != this->_M_impl._M_finish._M_last - 1)
- {
- this->_M_impl.construct(this->_M_impl._M_finish._M_cur,
- std::forward<_Args>(__args)...);
- ++this->_M_impl._M_finish._M_cur;
- }
- else
- _M_push_back_aux(std::forward<_Args>(__args)...);
- }
+ emplace_back(_Args&&... __args);
#endif
/**
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index a631b0e..08fb89e 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -833,15 +833,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* done in constant time, and does not invalidate iterators and
* references.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push_front(const value_type& __x)
{ this->_M_insert(begin(), __x); }
-#else
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_front(value_type&& __x)
+ { this->_M_insert(begin(), std::move(__x)); }
+
template<typename... _Args>
void
- push_front(_Args&&... __args)
- { this->_M_insert(begin(), std::forward<_Args>(__args)...); }
+ emplace_front(_Args&&... __args)
+ { this->_M_insert(begin(), std::forward<_Args>(__args)...); }
#endif
/**
@@ -870,15 +874,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* in constant time, and does not invalidate iterators and
* references.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push_back(const value_type& __x)
{ this->_M_insert(end(), __x); }
-#else
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_back(value_type&& __x)
+ { this->_M_insert(end(), std::move(__x)); }
+
template<typename... _Args>
void
- push_back(_Args&&... __args)
- { this->_M_insert(end(), std::forward<_Args>(__args)...); }
+ emplace_back(_Args&&... __args)
+ { this->_M_insert(end(), std::forward<_Args>(__args)...); }
#endif
/**
diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h
index 4ab3c46..053a59c 100644
--- a/libstdc++-v3/include/bits/stl_queue.h
+++ b/libstdc++-v3/include/bits/stl_queue.h
@@ -1,6 +1,6 @@
// Queue implementation -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -220,16 +220,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* to it. The time complexity of the operation depends on the
* underlying sequence.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push(const value_type& __x)
{ c.push_back(__x); }
-#else
- // NB: DR 756.
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push(value_type&& __x)
+ { c.push_back(std::move(__x)); }
+
template<typename... _Args>
void
- push(_Args&&... __args)
- { c.push_back(std::forward<_Args>(__args)...); }
+ emplace(_Args&&... __args)
+ { c.emplace_back(std::forward<_Args>(__args)...); }
#endif
/**
@@ -509,20 +512,26 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* The time complexity of the operation depends on the underlying
* sequence.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push(const value_type& __x)
{
c.push_back(__x);
std::push_heap(c.begin(), c.end(), comp);
}
-#else
- // NB: DR 756.
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push(value_type&& __x)
+ {
+ c.push_back(std::move(__x));
+ std::push_heap(c.begin(), c.end(), comp);
+ }
+
template<typename... _Args>
void
- push(_Args&&... __args)
- {
- c.push_back(std::forward<_Args>(__args)...);
+ emplace(_Args&&... __args)
+ {
+ c.emplace_back(std::forward<_Args>(__args)...);
std::push_heap(c.begin(), c.end(), comp);
}
#endif
diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h
index 932388a..13e4b7a 100644
--- a/libstdc++-v3/include/bits/stl_stack.h
+++ b/libstdc++-v3/include/bits/stl_stack.h
@@ -1,6 +1,6 @@
// Stack implementation -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -184,16 +184,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* to it. The time complexity of the operation depends on the
* underlying sequence.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push(const value_type& __x)
{ c.push_back(__x); }
-#else
- // NB: DR 756.
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push(value_type&& __x)
+ { c.push_back(std::move(__x)); }
+
template<typename... _Args>
void
- push(_Args&&... __args)
- { c.push_back(std::forward<_Args>(__args)...); }
+ emplace(_Args&&... __args)
+ { c.emplace_back(std::forward<_Args>(__args)...); }
#endif
/**
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 34bb595..aa874089 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -681,7 +681,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* done in constant time if the %vector has preallocated space
* available.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push_back(const value_type& __x)
{
@@ -693,20 +692,15 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
else
_M_insert_aux(end(), __x);
}
-#else
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_back(value_type&& __x)
+ { emplace_back(std::move(__x)); }
+
template<typename... _Args>
void
- push_back(_Args&&... __args)
- {
- if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
- {
- this->_M_impl.construct(this->_M_impl._M_finish,
- std::forward<_Args>(__args)...);
- ++this->_M_impl._M_finish;
- }
- else
- _M_insert_aux(end(), std::forward<_Args>(__args)...);
- }
+ emplace_back(_Args&&... __args);
#endif
/**
diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc
index 462d18f..04f76ca 100644
--- a/libstdc++-v3/include/bits/vector.tcc
+++ b/libstdc++-v3/include/bits/vector.tcc
@@ -88,6 +88,24 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
}
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Tp, typename _Alloc>
+ template<typename... _Args>
+ void
+ vector<_Tp, _Alloc>::
+ emplace_back(_Args&&... __args)
+ {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ {
+ this->_M_impl.construct(this->_M_impl._M_finish,
+ std::forward<_Args>(__args)...);
+ ++this->_M_impl._M_finish;
+ }
+ else
+ _M_insert_aux(end(), std::forward<_Args>(__args)...);
+ }
+#endif
+
template<typename _Tp, typename _Alloc>
typename vector<_Tp, _Alloc>::iterator
vector<_Tp, _Alloc>::
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
index 2f967b4..c37381f 100644
--- a/libstdc++-v3/include/debug/deque
+++ b/libstdc++-v3/include/debug/deque
@@ -1,6 +1,6 @@
// Debugging deque implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -254,7 +254,6 @@ namespace __debug
}
// 23.2.1.3 modifiers:
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push_front(const _Tp& __x)
{
@@ -268,20 +267,29 @@ namespace __debug
_Base::push_back(__x);
this->_M_invalidate_all();
}
-#else
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_front(_Tp&& __x)
+ { emplace_front(std::move(__x)); }
+
+ void
+ push_back(_Tp&& __x)
+ { emplace_back(std::move(__x)); }
+
template<typename... _Args>
void
- push_front(_Args&&... __args)
+ emplace_front(_Args&&... __args)
{
- _Base::push_front(std::forward<_Args>(__args)...);
+ _Base::emplace_front(std::forward<_Args>(__args)...);
this->_M_invalidate_all();
}
template<typename... _Args>
void
- push_back(_Args&&... __args)
+ emplace_back(_Args&&... __args)
{
- _Base::push_back(std::forward<_Args>(__args)...);
+ _Base::emplace_back(std::forward<_Args>(__args)...);
this->_M_invalidate_all();
}
diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list
index d0797e9..7ab0bdd 100644
--- a/libstdc++-v3/include/debug/list
+++ b/libstdc++-v3/include/debug/list
@@ -280,6 +280,10 @@ namespace __debug
// 23.2.2.3 modifiers:
using _Base::push_front;
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ using _Base::emplace_front;
+#endif
+
void
pop_front()
{
@@ -291,6 +295,10 @@ namespace __debug
using _Base::push_back;
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ using _Base::emplace_back;
+#endif
+
void
pop_back()
{
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
index 7945b54..12bd52f 100644
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -289,7 +289,6 @@ namespace __debug
using _Base::data;
// 23.2.4.3 modifiers:
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push_back(const _Tp& __x)
{
@@ -299,13 +298,18 @@ namespace __debug
this->_M_invalidate_all();
_M_update_guaranteed_capacity();
}
-#else
+
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ push_back(_Tp&& __x)
+ { emplace_back(std::move(__x)); }
+
template<typename... _Args>
void
- push_back(_Args&&... __args)
+ emplace_back(_Args&&... __args)
{
bool __realloc = _M_requires_reallocation(this->size() + 1);
- _Base::push_back(std::forward<_Args>(__args)...);
+ _Base::emplace_back(std::forward<_Args>(__args)...);
if (__realloc)
this->_M_invalidate_all();
_M_update_guaranteed_capacity();
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
index 3d40c00..2cb464c 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
@@ -1,6 +1,6 @@
// 2007-04-27 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2007 Free Software Foundation
+// Copyright (C) 2007, 2008 Free Software Foundation
//
// 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
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1449 }
+// { dg-error "no matching" "" { target *-*-* } 1436 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
index fb4c40e..57c865f3 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1388 }
+// { dg-error "no matching" "" { target *-*-* } 1375 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
index 1f24c98..a46674c 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1388 }
+// { dg-error "no matching" "" { target *-*-* } 1375 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
index 522022a..3ae748c 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1533 }
+// { dg-error "no matching" "" { target *-*-* } 1520 }
// { dg-excess-errors "" }
#include <deque>
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
index 1478f3d..8eeff63 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1317 }
+// { dg-error "no matching" "" { target *-*-* } 1325 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
index d5dc390..06b7162 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1286 }
+// { dg-error "no matching" "" { target *-*-* } 1294 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
index 10f726b..bfe8710 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1286 }
+// { dg-error "no matching" "" { target *-*-* } 1294 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
index 1a97c4b..d75ed06 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1286 }
+// { dg-error "no matching" "" { target *-*-* } 1294 }
// { dg-excess-errors "" }
#include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
index eb6aa1f..64c6a98 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 992 }
+// { dg-error "no matching" "" { target *-*-* } 986 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
index 6e65a5e..34e602d 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 932 }
+// { dg-error "no matching" "" { target *-*-* } 926 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
index dce05ed..f1af46c 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 932 }
+// { dg-error "no matching" "" { target *-*-* } 926 }
// { dg-excess-errors "" }
#include <vector>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
index 3df2fc8..a95f578 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
@@ -1,6 +1,6 @@
// 2007-04-27 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2007 Free Software Foundation
+// Copyright (C) 2007, 2008 Free Software Foundation
//
// 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
@@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1033 }
+// { dg-error "no matching" "" { target *-*-* } 1027 }
// { dg-excess-errors "" }
#include <vector>