summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/debug/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/debug/map.h')
-rw-r--r--libstdc++-v3/include/debug/map.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h
index 688fb99d499..9bda8eba1da 100644
--- a/libstdc++-v3/include/debug/map.h
+++ b/libstdc++-v3/include/debug/map.h
@@ -307,9 +307,14 @@ namespace __debug
void
insert(_InputIterator __first, _InputIterator __last)
{
- __glibcxx_check_valid_range(__first, __last);
- _Base::insert(__gnu_debug::__base(__first),
- __gnu_debug::__base(__last));
+ typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
+ __glibcxx_check_valid_range2(__first, __last, __dist);
+
+ if (__dist.second >= __gnu_debug::__dp_sign)
+ _Base::insert(__gnu_debug::__unsafe(__first),
+ __gnu_debug::__unsafe(__last));
+ else
+ _Base::insert(__first, __last);
}
#if __cplusplus >= 201103L