+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
// 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
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>::
* 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)
{
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
/**
* 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)
{
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
/**
* 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
/**
* 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
/**
// 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
* 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
/**
* 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
// 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
* 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
/**
* done in constant time if the %vector has preallocated space
* available.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push_back(const value_type& __x)
{
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
/**
}
}
+#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>::
// 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
}
// 23.2.1.3 modifiers:
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push_front(const _Tp& __x)
{
_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();
}
// 23.2.2.3 modifiers:
using _Base::push_front;
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ using _Base::emplace_front;
+#endif
+
void
pop_front()
{
using _Base::push_back;
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ using _Base::emplace_back;
+#endif
+
void
pop_back()
{
using _Base::data;
// 23.2.4.3 modifiers:
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push_back(const _Tp& __x)
{
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();
// 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
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1449 }
+// { dg-error "no matching" "" { target *-*-* } 1436 }
// { dg-excess-errors "" }
#include <deque>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1388 }
+// { dg-error "no matching" "" { target *-*-* } 1375 }
// { dg-excess-errors "" }
#include <deque>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1388 }
+// { dg-error "no matching" "" { target *-*-* } 1375 }
// { dg-excess-errors "" }
#include <deque>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1533 }
+// { dg-error "no matching" "" { target *-*-* } 1520 }
// { dg-excess-errors "" }
#include <deque>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1317 }
+// { dg-error "no matching" "" { target *-*-* } 1325 }
// { dg-excess-errors "" }
#include <list>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1286 }
+// { dg-error "no matching" "" { target *-*-* } 1294 }
// { dg-excess-errors "" }
#include <list>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1286 }
+// { dg-error "no matching" "" { target *-*-* } 1294 }
// { dg-excess-errors "" }
#include <list>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1286 }
+// { dg-error "no matching" "" { target *-*-* } 1294 }
// { dg-excess-errors "" }
#include <list>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 992 }
+// { dg-error "no matching" "" { target *-*-* } 986 }
// { dg-excess-errors "" }
#include <vector>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 932 }
+// { dg-error "no matching" "" { target *-*-* } 926 }
// { dg-excess-errors "" }
#include <vector>
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 932 }
+// { dg-error "no matching" "" { target *-*-* } 926 }
// { dg-excess-errors "" }
#include <vector>
// 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
// USA.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1033 }
+// { dg-error "no matching" "" { target *-*-* } 1027 }
// { dg-excess-errors "" }
#include <vector>