summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/debug
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-05 01:15:28 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-05 01:15:28 +0000
commit9c7351ae10e3e9401983af4ad6cb33fa14f9db5d (patch)
tree6c290c31ed518698ccc30d08c831ee001d0cde00 /libstdc++-v3/include/debug
parent0fca2a367b6a129c7b05592a63bd9c860e346714 (diff)
downloadgcc-9c7351ae10e3e9401983af4ad6cb33fa14f9db5d.tar.gz
2012-03-04 Paolo Carlini <paolo.carlini@oracle.com>
Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/43813 * include/bits/stl_iterator_base_types.h (_RequireInputIter): New. * include/ext/vstring.h (__versa_string<>::__versa_string (_InputIterator, _InputIterator, const _Alloc&), __versa_string<>::append(_InputIterator, _InputIterator), __versa_string<>::assign(_InputIterator, _InputIterator), __versa_string<>::insert(iterator, _InputIterator, _InputIterator), __versa_string<>::replace(iterator, iterator, _InputIterator, _InputIterator)): Use it. * include/bits/stl_list.h (list<>::list(_InputIterator, _InputIterator, const allocator_type&), list<>::assign(_InputIterator, _InputIterator), list<>::insert(iterator, _InputIterator, _InputIterator)): Likewise. * include/bits/stl_vector.h (vector<>::vector(_InputIterator, _InputIterator, const allocator_type&), vector<>::assign(_InputIterator, _InputIterator), vectort<>::insert(iterator, _InputIterator, _InputIterator)): Likewise. * include/bits/stl_deque.h (deque<>::deque(_InputIterator, _InputIterator, const allocator_type&), deque<>::deque(_InputIterator, _InputIterator), deque<>::insert(iterator, _InputIterator, _InputIterator)): Likewise. * include/bits/stl_bvector.h (vector<>::vector(_InputIterator, _InputIterator, const allocator_type&), vector<>::deque(_InputIterator, _InputIterator), vector<>::insert(iterator, _InputIterator, _InputIterator)): Likewise. * include/bits/forward_list.h (forward_list<>::forward_list (_InputIterator, _InputIterator, const allocator_type&), forward_list<>::assign(_InputIterator, _InputIterator), forward_list<>::insert_after(const_iterator, _InputIterator, _InputIterator)): Likewise. (forward_list<>::_M_initialize_dispatch(,, __true_type): Remove. (forward_list<>::_M_range_initialize): Add, adjust everywhere. * include/bits/forward_list.tcc: Adjust. * include/debug/forward_list: Adjust. * include/debug/vector: Likewise. * include/debug/deque: Likewise. * include/debug/list: Likewise. * testsuite/ext/vstring/requirements/do_the_right_thing.cc: New. * testsuite/23_containers/forward_list/requirements/ do_the_right_thing.cc: Likewise. * testsuite/23_containers/vector/requirements/ do_the_right_thing.cc: Likewise. * testsuite/23_containers/deque/requirements/ do_the_right_thing.cc: Likewise. * testsuite/23_containers/list/requirements/ do_the_right_thing.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ assign_neg.cc: Likewise. * 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: Likewise. * 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: Likewise. * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184911 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug')
-rw-r--r--libstdc++-v3/include/debug/deque18
-rw-r--r--libstdc++-v3/include/debug/forward_list15
-rw-r--r--libstdc++-v3/include/debug/list31
-rw-r--r--libstdc++-v3/include/debug/vector18
4 files changed, 66 insertions, 16 deletions
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
index 07b332b0191..ce09cb26ab7 100644
--- a/libstdc++-v3/include/debug/deque
+++ b/libstdc++-v3/include/debug/deque
@@ -1,6 +1,7 @@
// Debugging deque implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+// 2012
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -88,7 +89,12 @@ namespace __debug
: _Base(__n, __value, __a) { }
#endif
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+#else
template<class _InputIterator>
+#endif
deque(_InputIterator __first, _InputIterator __last,
const _Allocator& __a = _Allocator())
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
@@ -142,7 +148,12 @@ namespace __debug
}
#endif
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+#else
template<class _InputIterator>
+#endif
void
assign(_InputIterator __first, _InputIterator __last)
{
@@ -413,7 +424,12 @@ namespace __debug
this->_M_invalidate_all();
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+#else
template<class _InputIterator>
+#endif
void
insert(iterator __position,
_InputIterator __first, _InputIterator __last)
diff --git a/libstdc++-v3/include/debug/forward_list b/libstdc++-v3/include/debug/forward_list
index b74b38a02bc..9024ff90406 100644
--- a/libstdc++-v3/include/debug/forward_list
+++ b/libstdc++-v3/include/debug/forward_list
@@ -1,6 +1,6 @@
// <forward_list> -*- C++ -*-
-// Copyright (C) 2010 Free Software Foundation, Inc.
+// Copyright (C) 2010, 2011, 2012 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
@@ -91,8 +91,9 @@ namespace __debug
: _Base(__n, __value, __al)
{ }
- template<typename _InputIterator>
- forward_list(_InputIterator __first, _InputIterator __last,
+ template<typename _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+ forward_list(_InputIterator __first, _InputIterator __last,
const _Alloc& __al = _Alloc())
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
__last)),
@@ -143,8 +144,9 @@ namespace __debug
return *this;
}
- template<typename _InputIterator>
- void
+ template<typename _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+ void
assign(_InputIterator __first, _InputIterator __last)
{
__glibcxx_check_valid_range(__first, __last);
@@ -273,7 +275,8 @@ namespace __debug
this);
}
- template<typename _InputIterator>
+ template<typename _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
iterator
insert_after(const_iterator __pos,
_InputIterator __first, _InputIterator __last)
diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list
index 3931a3d3b68..856ba1a60e2 100644
--- a/libstdc++-v3/include/debug/list
+++ b/libstdc++-v3/include/debug/list
@@ -1,6 +1,7 @@
// Debugging list implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+// 2012
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -89,14 +90,18 @@ namespace __debug
: _Base(__n, __value, __a) { }
#endif
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+#else
template<class _InputIterator>
- list(_InputIterator __first, _InputIterator __last,
- const _Allocator& __a = _Allocator())
- : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
- __last)),
- __gnu_debug::__base(__last), __a)
- { }
-
+#endif
+ list(_InputIterator __first, _InputIterator __last,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
+ __last)),
+ __gnu_debug::__base(__last), __a)
+ { }
list(const list& __x)
: _Base(__x) { }
@@ -151,7 +156,12 @@ namespace __debug
}
#endif
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+#else
template<class _InputIterator>
+#endif
void
assign(_InputIterator __first, _InputIterator __last)
{
@@ -405,7 +415,12 @@ namespace __debug
_Base::insert(__position.base(), __n, __x);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+#else
template<class _InputIterator>
+#endif
void
insert(iterator __position, _InputIterator __first,
_InputIterator __last)
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
index 5ee0fabc32a..d0b2627a620 100644
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -1,6 +1,7 @@
// Debugging vector implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+// 2012
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -95,7 +96,12 @@ namespace __debug
: _Base(__n, __value, __a), _M_guaranteed_capacity(__n) { }
#endif
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+#else
template<class _InputIterator>
+#endif
vector(_InputIterator __first, _InputIterator __last,
const _Allocator& __a = _Allocator())
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
@@ -170,7 +176,12 @@ namespace __debug
}
#endif
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+#else
template<typename _InputIterator>
+#endif
void
assign(_InputIterator __first, _InputIterator __last)
{
@@ -476,7 +487,12 @@ namespace __debug
_M_update_guaranteed_capacity();
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<class _InputIterator,
+ typename = std::_RequireInputIter<_InputIterator>>
+#else
template<class _InputIterator>
+#endif
void
insert(iterator __position,
_InputIterator __first, _InputIterator __last)