diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-07-01 16:17:46 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-07-01 16:17:46 +0000 |
commit | 019fdb7923b71f4fdac33e7f2cef3e0ebc0ce205 (patch) | |
tree | 954d3c967b1f7da29c4c24c4a97ea870e97aa70a /libstdc++-v3/testsuite/23_containers/list/operations | |
parent | 31f8442be7b47d847ec33b2bc3585bb184b7609b (diff) | |
download | gcc-019fdb7923b71f4fdac33e7f2cef3e0ebc0ce205.tar.gz |
stl_list.h (list<>::insert(iterator, size_type, const value_type&), [...]): Adjust C++11 signatures to take const_iterator(s).
2013-07-01 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_list.h (list<>::insert(iterator,
size_type, const value_type&), list<>::insert(iterator,
initializer_list<>), list<>::insert(iterator, _InputIterator,
_InputIterator), list<>::splice(iterator, list&&),
list<>::splice(iterator, list&), list<>::splice(iterator, list&&,
iterator), list<>::splice(iterator, list&, iterator),
list<>::splice(iterator, list&&, iterator, iterator),
list<>::splice(iterator, list&, iterator, iterator)): Adjust C++11
signatures to take const_iterator(s).
* include/bits/list.tcc (list<>::insert(const_iterator, size_type,
const value_type&), list<>::insert(const_iterator, _InputIterator,
_InputIterator)): Define.
* include/ext/vstring.h (__versa_string<>::insert(iterator,
size_type, _CharT), __versa_string<>::insert(iterator,
_InputIterator, _InputIterator), __versa_string<>::insert(iterator,
std::initializer_list<>), __versa_string<>::replace(iterator,
iterator, _InputIterator, _InputIterator), __versa_string<>::
replace(iterator, iterator, std::initializer_list<>)): Adjust C++11
signatures to take const_iterator(s).
(__versa_string<>::_M_replace_dispatch): Take const_iterators.
* include/ext/vstring.tcc: Likewise.
* include/debug/list: Adjust.
* include/profile/list: Likewise.
* testsuite/23_containers/list/operations/splice/const_iterator.cc:
New.
* testsuite/23_containers/list/modifiers/insert/const_iterator.cc:
Extend.
* testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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/list/requirements/dr438/insert_neg.cc:
Likewise.
From-SVN: r200580
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers/list/operations')
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/list/operations/splice/const_iterator.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/list/operations/splice/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/list/operations/splice/const_iterator.cc new file mode 100644 index 00000000000..a2544dc9b1e --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/operations/splice/const_iterator.cc @@ -0,0 +1,32 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <list> + +void test01() +{ + std::list<int> l1{0, 1}, l2{2, 3}; + l1.splice(l1.cbegin(), l2); + l2.splice(l2.cbegin(), std::move(l1)); + l1.splice(l1.cbegin(), l2, l2.cbegin()); + l2.splice(l2.cbegin(), std::move(l1), l1.cbegin()); + l1.splice(l1.cbegin(), l2, l2.cbegin(), l2.cend()); + l2.splice(l2.cbegin(), std::move(l1), l1.cbegin(), l1.cend()); +} |