summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/debug
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-14 00:15:00 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-14 00:15:00 +0000
commit28aa9e3ec8f13b49d7812db97aa4f21cd91c4497 (patch)
tree917d0c8c22795ee44263851c5ad26805d48a6fa9 /libstdc++-v3/include/debug
parentfad557f319eebd695a4c4e9f212f08954c264394 (diff)
downloadppe42-gcc-28aa9e3ec8f13b49d7812db97aa4f21cd91c4497.tar.gz
ppe42-gcc-28aa9e3ec8f13b49d7812db97aa4f21cd91c4497.zip
2003-11-13 Douglas Gregor <gregod@cs.rpi.edu>
* docs/html/debug.html: Users are allowed to specialize in namespace __gnu_debug, unlike in the Apple version of the debug mode. Clear up a confusing double-negative. Note that std::basic_string does provide extra debugging capabilities, but not safe iterators. * include/bits/basic_string.tcc: Make sure there's never an ambiguity when calling __is_null_pointer. * include/debug/deque: (deque::erase) Properly handle invalidation when erasing at the end of the deque. * include/debug/vector: (vector::swap): Swap _M_guaranteed_capacity. (vector::clear): Set the guaranteed capacity to 0. * testsuite/23_containers/deque/invalidation/4.cc: (test04): Test iterator invalidation when erasing at the end of the deque. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73564 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug')
-rw-r--r--libstdc++-v3/include/debug/deque2
-rw-r--r--libstdc++-v3/include/debug/vector3
2 files changed, 4 insertions, 1 deletions
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
index b9d68af598a..818d59e2b68 100644
--- a/libstdc++-v3/include/debug/deque
+++ b/libstdc++-v3/include/debug/deque
@@ -294,7 +294,7 @@ namespace __gnu_debug_def
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 151. can't currently clear() empty container
__glibcxx_check_erase_range(__first, __last);
- if (__first == begin() || __last == end()-1)
+ if (__first == begin() || __last == end())
{
this->_M_detach_singular();
for (iterator __position = __first; __position != __last; )
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
index 19249b6bb81..53e6f0cc15f 100644
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -34,6 +34,7 @@
#include <vector>
#include <debug/safe_sequence.h>
#include <debug/safe_iterator.h>
+#include <utility>
namespace __gnu_debug_def
{
@@ -328,6 +329,7 @@ namespace __gnu_debug_def
{
_Base::swap(__x);
this->_M_swap(__x);
+ std::swap(_M_guaranteed_capacity, __x._M_guaranteed_capacity);
}
void
@@ -335,6 +337,7 @@ namespace __gnu_debug_def
{
_Base::clear();
this->_M_invalidate_all();
+ _M_guaranteed_capacity = 0;
}
_Base&
OpenPOWER on IntegriCloud