This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Minor tweak to string
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 25 May 2005 13:35:52 +0200
- Subject: [v3] Minor tweak to string
HI,
noticed some time ago while working on v7, then got distracted...
Tested x86-linux, committed.
/////////////
2005-05-25 Paolo Carlini <pcarlini@suse.de>
* include/bits/basic_string.h (_Rep::_M_set_length_and_sharable):
Use, consistently, traits_type::assign.
diff -urN libstdc++-v3-orig/include/bits/basic_string.h libstdc++-v3/include/bits/basic_string.h
--- libstdc++-v3-orig/include/bits/basic_string.h 2005-05-19 10:59:46.000000000 +0200
+++ libstdc++-v3/include/bits/basic_string.h 2005-05-25 12:57:55.000000000 +0200
@@ -198,7 +198,8 @@
{
this->_M_set_sharable(); // One reference.
this->_M_length = __n;
- this->_M_refdata()[__n] = _S_terminal; // grrr. (per 21.3.4)
+ traits_type::assign(this->_M_refdata()[__n], _S_terminal);
+ // grrr. (per 21.3.4)
// You cannot leave those LWG people alone for a second.
}