diff options
Diffstat (limited to 'gcc-4.6/libstdc++-v3/include/debug')
-rw-r--r-- | gcc-4.6/libstdc++-v3/include/debug/bitset | 2 | ||||
-rw-r--r-- | gcc-4.6/libstdc++-v3/include/debug/deque | 6 | ||||
-rw-r--r-- | gcc-4.6/libstdc++-v3/include/debug/map.h | 4 | ||||
-rw-r--r-- | gcc-4.6/libstdc++-v3/include/debug/multimap.h | 4 | ||||
-rw-r--r-- | gcc-4.6/libstdc++-v3/include/debug/unordered_map | 8 | ||||
-rw-r--r-- | gcc-4.6/libstdc++-v3/include/debug/unordered_set | 8 | ||||
-rw-r--r-- | gcc-4.6/libstdc++-v3/include/debug/vector | 17 |
7 files changed, 41 insertions, 8 deletions
diff --git a/gcc-4.6/libstdc++-v3/include/debug/bitset b/gcc-4.6/libstdc++-v3/include/debug/bitset index c187545..09929e7 100644 --- a/gcc-4.6/libstdc++-v3/include/debug/bitset +++ b/gcc-4.6/libstdc++-v3/include/debug/bitset @@ -409,7 +409,7 @@ namespace __debug : public __hash_base<size_t, __debug::bitset<_Nb>> { size_t - operator()(const __debug::bitset<_Nb>& __b) const + operator()(const __debug::bitset<_Nb>& __b) const noexcept { return std::hash<_GLIBCXX_STD_C::bitset<_Nb>>()(__b._M_base()); } }; #endif diff --git a/gcc-4.6/libstdc++-v3/include/debug/deque b/gcc-4.6/libstdc++-v3/include/debug/deque index ee17f20..fc4d8cb 100644 --- a/gcc-4.6/libstdc++-v3/include/debug/deque +++ b/gcc-4.6/libstdc++-v3/include/debug/deque @@ -460,7 +460,11 @@ namespace __debug // _GLIBCXX_RESOLVE_LIB_DEFECTS // 151. can't currently clear() empty container __glibcxx_check_erase_range(__first, __last); - if (__first.base() == _Base::begin() || __last.base() == _Base::end()) + + if (__first.base() == __last.base()) + return __first; + else if (__first.base() == _Base::begin() + || __last.base() == _Base::end()) { this->_M_detach_singular(); for (_Base_iterator __position = __first.base(); diff --git a/gcc-4.6/libstdc++-v3/include/debug/map.h b/gcc-4.6/libstdc++-v3/include/debug/map.h index 3108519..177797d 100644 --- a/gcc-4.6/libstdc++-v3/include/debug/map.h +++ b/gcc-4.6/libstdc++-v3/include/debug/map.h @@ -273,6 +273,10 @@ namespace __debug this->_M_invalidate_if(_Equal(__position.base())); return iterator(_Base::erase(__position.base()), this); } + + iterator + erase(iterator __position) + { return erase(const_iterator(__position)); } #else void erase(iterator __position) diff --git a/gcc-4.6/libstdc++-v3/include/debug/multimap.h b/gcc-4.6/libstdc++-v3/include/debug/multimap.h index 3c22517..d2e1976 100644 --- a/gcc-4.6/libstdc++-v3/include/debug/multimap.h +++ b/gcc-4.6/libstdc++-v3/include/debug/multimap.h @@ -254,6 +254,10 @@ namespace __debug this->_M_invalidate_if(_Equal(__position.base())); return iterator(_Base::erase(__position.base()), this); } + + iterator + erase(iterator __position) + { return erase(const_iterator(__position)); } #else void erase(iterator __position) diff --git a/gcc-4.6/libstdc++-v3/include/debug/unordered_map b/gcc-4.6/libstdc++-v3/include/debug/unordered_map index 2d7e100..43b1e9c 100644 --- a/gcc-4.6/libstdc++-v3/include/debug/unordered_map +++ b/gcc-4.6/libstdc++-v3/include/debug/unordered_map @@ -276,6 +276,10 @@ namespace __debug } iterator + erase(iterator __it) + { return erase(const_iterator(__it)); } + + iterator erase(const_iterator __first, const_iterator __last) { __glibcxx_check_erase_range(__first, __last); @@ -558,6 +562,10 @@ namespace __debug } iterator + erase(iterator __it) + { return erase(const_iterator(__it)); } + + iterator erase(const_iterator __first, const_iterator __last) { __glibcxx_check_erase_range(__first, __last); diff --git a/gcc-4.6/libstdc++-v3/include/debug/unordered_set b/gcc-4.6/libstdc++-v3/include/debug/unordered_set index e30f976..cf21a3c 100644 --- a/gcc-4.6/libstdc++-v3/include/debug/unordered_set +++ b/gcc-4.6/libstdc++-v3/include/debug/unordered_set @@ -269,6 +269,10 @@ namespace __debug } iterator + erase(iterator __it) + { return erase(const_iterator(__it)); } + + iterator erase(const_iterator __first, const_iterator __last) { __glibcxx_check_erase_range(__first, __last); @@ -539,6 +543,10 @@ namespace __debug } iterator + erase(iterator __it) + { return erase(const_iterator(__it)); } + + iterator erase(const_iterator __first, const_iterator __last) { __glibcxx_check_erase_range(__first, __last); 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()); } }; |