aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6/libstdc++-v3/include/debug/vector
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.6/libstdc++-v3/include/debug/vector')
-rw-r--r--gcc-4.6/libstdc++-v3/include/debug/vector17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc-4.6/libstdc++-v3/include/debug/vector b/gcc-4.6/libstdc++-v3/include/debug/vector
index e2dd71a..edb1f88 100644
--- a/gcc-4.6/libstdc++-v3/include/debug/vector
+++ b/gcc-4.6/libstdc++-v3/include/debug/vector
@@ -492,11 +492,16 @@ namespace __debug
// 151. can't currently clear() empty container
__glibcxx_check_erase_range(__first, __last);
- difference_type __offset = __first.base() - _Base::begin();
- _Base_iterator __res = _Base::erase(__first.base(),
- __last.base());
- this->_M_invalidate_after_nth(__offset);
- return iterator(__res, this);
+ if (__first.base() != __last.base())
+ {
+ difference_type __offset = __first.base() - _Base::begin();
+ _Base_iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_after_nth(__offset);
+ return iterator(__res, this);
+ }
+ else
+ return __first;
}
void
@@ -594,7 +599,7 @@ namespace __debug
: public __hash_base<size_t, __debug::vector<bool, _Alloc>>
{
size_t
- operator()(const __debug::vector<bool, _Alloc>& __b) const
+ operator()(const __debug::vector<bool, _Alloc>& __b) const noexcept
{ return std::hash<_GLIBCXX_STD_C::vector<bool, _Alloc>>()
(__b._M_base()); }
};