[Patch] Some work on money_get::do_get
Paolo Carlini
pcarlini@suse.de
Thu Oct 23 11:33:00 GMT 2003
Hi,
this all started trying to avoid this loop:
while (__tmp_units.size() > 1 && __tmp_units[0] == __ctype.widen('0'))
__tmp_units.erase(__tmp_units.begin());
that I didn't like (repeated calls to widen, repetead calls to erase...).
In the process, I noticed two conformance issues (see testcases):
1- According to 22.2.6.1.2, p4, "... preceded by a minus sign if and
only if the result is negative" (see first test).
2- We tried to fail whenever __tmp_units was empty, but failed to do
it when _sign.size() && __sign == __neg_sign (see second test).
I find the final result quite clean and efficient ;)
Tested x86-linux, will wait a little for comments, as usual.
Paolo.
////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_money_get
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20031023/dc523396/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_money_get
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20031023/dc523396/attachment-0001.ksh>
More information about the Libstdc++
mailing list