summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/debug
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-27 09:51:21 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-27 09:51:21 +0000
commit3d2b2f494d78e0f4168d2c7ba5a76c05b4f4af71 (patch)
tree34f47ec02fbda70b1690f99110cc522ce6e593a0 /libstdc++-v3/include/debug
parent5ada7a142c1df1fad051c42f408d84df72a06b4c (diff)
downloadgcc-3d2b2f494d78e0f4168d2c7ba5a76c05b4f4af71.tar.gz
2013-06-27 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_deque.h (deque<>::insert(iterator, const value_type&), deque<>::insert(iterator, value_type&&), deque<>::emplace(iterator, _Args&&...)): Adjust C++11 signatures to take a const_iterator. (deque<>::erase): Simplify. * include/bits/stl_list.h: Likewise. (_List_iterator<>::_M_const_cast): Add. * include/bits/stl_vector.h: Likewise. * include/bits/stl_bvector.h: Likewise. (_Bit_iterator::_M_const_cast): Add. * include/bits/deque.tcc: Adjust definitions. * include/bits/list.tcc: Likewise. * include/bits/vector.tcc: Likewise. * include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast): Define trivial version in C++98 mode. * include/ext/vstring.h (__versa_string<>::insert(iterator, _CharT), __versa_string<>::replace(iterator, iterator, const __versa_string&), __versa_string<>::replace(iterator, iterator, const _CharT*, size_type), __versa_string<>::replace(iterator, iterator, const _CharT*), __versa_string<>::replace(iterator, iterator, size_type, _CharT)): Adjust C++11 signatures to take a pair of const_iterators. * include/debug/deque: Adjust. * include/debug/list: Likewise. * include/debug/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/profile/vector: Likewise. (vector<>::emplace): Add. * testsuite/util/exception/safety.h: Update. * testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc: New. * testsuite/23_containers/deque/modifiers/insert/const_iterator.cc: Likewise. * testsuite/23_containers/list/modifiers/emplace/const_iterator.cc: Likewise. * testsuite/23_containers/list/modifiers/insert/const_iterator.cc: Likewise. * testsuite/23_containers/vector/bool/modifiers/insert/ const_iterator.cc: Likewise. * testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc: Likewise. * testsuite/23_containers/vector/modifiers/insert/const_iterator.cc: Likewise. * 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/ext/vstring/modifiers/char/54577.cc: Move to testsuite/ ext/vstring/modifiers/erase/char/. * testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Move to testsuite/ ext/vstring/modifiers/wchar_t/. * testsuite/ext/vstring/modifiers/char/pop_back.cc: Move to testsuite/ ext/vstring/modifiers/pop_back/char/. * testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc: Move to testsuite/ext/vstring/modifiers/pop_back/wchar_t/. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * 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/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_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/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_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/vector/requirements/dr438/insert_neg.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200458 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug')
-rw-r--r--libstdc++-v3/include/debug/deque8
-rw-r--r--libstdc++-v3/include/debug/list20
-rw-r--r--libstdc++-v3/include/debug/vector8
3 files changed, 24 insertions, 12 deletions
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
index 2ac6d252e1d..638bf1cd3ca 100644
--- a/libstdc++-v3/include/debug/deque
+++ b/libstdc++-v3/include/debug/deque
@@ -383,7 +383,7 @@ namespace __debug
template<typename... _Args>
iterator
- emplace(iterator __position, _Args&&... __args)
+ emplace(const_iterator __position, _Args&&... __args)
{
__glibcxx_check_insert(__position);
_Base_iterator __res = _Base::emplace(__position.base(),
@@ -394,7 +394,11 @@ namespace __debug
#endif
iterator
+#if __cplusplus >= 201103L
+ insert(const_iterator __position, const _Tp& __x)
+#else
insert(iterator __position, const _Tp& __x)
+#endif
{
__glibcxx_check_insert(__position);
_Base_iterator __res = _Base::insert(__position.base(), __x);
@@ -404,7 +408,7 @@ namespace __debug
#if __cplusplus >= 201103L
iterator
- insert(iterator __position, _Tp&& __x)
+ insert(const_iterator __position, _Tp&& __x)
{ return emplace(__position, std::move(__x)); }
void
diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list
index 9bc47124f39..c175de01f23 100644
--- a/libstdc++-v3/include/debug/list
+++ b/libstdc++-v3/include/debug/list
@@ -379,7 +379,7 @@ namespace __debug
#if __cplusplus >= 201103L
template<typename... _Args>
iterator
- emplace(iterator __position, _Args&&... __args)
+ emplace(const_iterator __position, _Args&&... __args)
{
__glibcxx_check_insert(__position);
return iterator(_Base::emplace(__position.base(),
@@ -387,16 +387,20 @@ namespace __debug
}
#endif
- iterator
- insert(iterator __position, const _Tp& __x)
- {
- __glibcxx_check_insert(__position);
- return iterator(_Base::insert(__position.base(), __x), this);
- }
+ iterator
+#if __cplusplus >= 201103L
+ insert(const_iterator __position, const _Tp& __x)
+#else
+ insert(iterator __position, const _Tp& __x)
+#endif
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
#if __cplusplus >= 201103L
iterator
- insert(iterator __position, _Tp&& __x)
+ insert(const_iterator __position, _Tp&& __x)
{ return emplace(__position, std::move(__x)); }
void
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
index 4a65518bc82..f55dc67ede0 100644
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -429,7 +429,7 @@ namespace __debug
#if __cplusplus >= 201103L
template<typename... _Args>
iterator
- emplace(iterator __position, _Args&&... __args)
+ emplace(const_iterator __position, _Args&&... __args)
{
__glibcxx_check_insert(__position);
bool __realloc = _M_requires_reallocation(this->size() + 1);
@@ -446,7 +446,11 @@ namespace __debug
#endif
iterator
+#if __cplusplus >= 201103L
+ insert(const_iterator __position, const _Tp& __x)
+#else
insert(iterator __position, const _Tp& __x)
+#endif
{
__glibcxx_check_insert(__position);
bool __realloc = _M_requires_reallocation(this->size() + 1);
@@ -464,7 +468,7 @@ namespace __debug
template<typename _Up = _Tp>
typename __gnu_cxx::__enable_if<!std::__are_same<_Up, bool>::__value,
iterator>::__type
- insert(iterator __position, _Tp&& __x)
+ insert(const_iterator __position, _Tp&& __x)
{ return emplace(__position, std::move(__x)); }
void