summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/debug/safe_iterator.h
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-18 03:27:57 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-18 03:27:57 +0000
commit978981af2a2042f7380ef200cbab770a24daa8b4 (patch)
tree4a0820b77b1ca2936bfaad93db204a507ced96e5 /libstdc++-v3/include/debug/safe_iterator.h
parent52dc45c89861df90e305cfd470df94e527e8c192 (diff)
downloadppe42-gcc-978981af2a2042f7380ef200cbab770a24daa8b4.tar.gz
ppe42-gcc-978981af2a2042f7380ef200cbab770a24daa8b4.zip
2004-05-17 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/testsuite_hooks.h (__gnu_test::conversion): New class. * testsuite/23_containers/deque/14340.cc: New. * testsuite/23_containers/list/14340.cc: New. * testsuite/23_containers/map/14340.cc: New. * testsuite/23_containers/multimap/14340.cc: New. * testsuite/23_containers/multiset/14340.cc: New. * testsuite/23_containers/set/14340.cc: New. * testsuite/23_containers/vector/14340.cc: New. 2004-05-17 Douglas Gregor <gregod@cs.rpi.edu> PR libstdc++/14340 * include/debug/safe_iterator.h (_Safe_iterator converting constructor): Only allow declaration to instantiate when the incoming _Safe_iterator has exactly the right iterator type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81970 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug/safe_iterator.h')
-rw-r--r--libstdc++-v3/include/debug/safe_iterator.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/include/debug/safe_iterator.h
index 7482d6caa65..8a4123af694 100644
--- a/libstdc++-v3/include/debug/safe_iterator.h
+++ b/libstdc++-v3/include/debug/safe_iterator.h
@@ -35,6 +35,7 @@
#include <debug/debug.h>
#include <debug/formatter.h>
#include <debug/safe_base.h>
+#include <bits/cpp_type_traits.h>
namespace __gnu_debug
{
@@ -88,6 +89,7 @@ namespace __gnu_debug
typedef iterator_traits<_Iterator> _Traits;
public:
+ typedef _Iterator _Base_iterator;
typedef typename _Traits::iterator_category iterator_category;
typedef typename _Traits::value_type value_type;
typedef typename _Traits::difference_type difference_type;
@@ -132,7 +134,13 @@ namespace __gnu_debug
* @pre @p x is not singular
*/
template<typename _MutableIterator>
- _Safe_iterator(const _Safe_iterator<_MutableIterator, _Sequence>& __x)
+ _Safe_iterator(
+ const _Safe_iterator<_MutableIterator,
+ typename std::__enable_if<
+ _Sequence,
+ (std::__are_same<_MutableIterator,
+ typename _Sequence::iterator::_Base_iterator>::_M_type)
+ >::_M_type>& __x)
: _Safe_iterator_base(__x, _M_constant()), _M_current(__x.base())
{
_GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
OpenPOWER on IntegriCloud