diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a9556d7a9512cd757973ce93bea652da69f5696e..9d692ab132a84e701b42133fddefed61ca01792a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2006-08-18 Paolo Carlini <pcarlini@suse.de> + + PR libstdc++/28765 + * include/ext/rc_string_base.h (_M_clear): New. + * include/ext/sso_string_base.h (_M_clear): Likewise. + * include/ext/vstring.h (clear): Use it. + 2006-08-15 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (poisson_distribution<>::_M_initialize): Add. diff --git a/libstdc++-v3/include/ext/rc_string_base.h b/libstdc++-v3/include/ext/rc_string_base.h index eec6f2dcf0d1a2c2e571e749f176c87861834577..1a896d827fee79e56c0e8af2c4548b3323ed7a0a 100644 --- a/libstdc++-v3/include/ext/rc_string_base.h +++ b/libstdc++-v3/include/ext/rc_string_base.h @@ -338,6 +338,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) void _M_erase(size_type __pos, size_type __n); + void + _M_clear() + { _M_erase(size_type(0), _M_length()); } + bool _M_compare(const __rc_string_base&) const { return false; } diff --git a/libstdc++-v3/include/ext/sso_string_base.h b/libstdc++-v3/include/ext/sso_string_base.h index 1282eb6e53e996bf05e697fcf61751ec7668935a..30988260dd7934f4f00498640a5d64d683eb1f16 100644 --- a/libstdc++-v3/include/ext/sso_string_base.h +++ b/libstdc++-v3/include/ext/sso_string_base.h @@ -226,6 +226,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) void _M_erase(size_type __pos, size_type __n); + void + _M_clear() + { _M_set_length(0); } + bool _M_compare(const __sso_string_base&) const { return false; } diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h index 5cd84b15a30715c78fa2276a80b667b3c41b00a7..d858949db467636fada95a03e2ccb4d227b88ac3 100644 --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -409,7 +409,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) */ void clear() - { this->_M_erase(size_type(0), this->size()); } + { this->_M_clear(); } /** * Returns true if the %string is empty. Equivalent to *this == "".