[RFC] Money_get::do_get appends?!?

Paolo Carlini pcarlini@unitus.it
Sun Feb 3 14:49:00 GMT 2002


Nathan Myers wrote:

>On Sun, Feb 03, 2002 at 09:38:23PM +0100, Paolo Carlini wrote:
>
>> money_get::do_get always *appends* to the string
>>__units passed by reference. Therefore, the second time it starts 
>>from "123" and appends "456".  Would be acceptable a fix simply calling
>>__units.erase() at the beginning of money_get::do_get??
>>
>
>Almost.  If it fails, it must leave the string unchanged.
>
Ah!
Thanks Nathan.
This makes things a little bit more difficult however... and, spilling 
the beans, I'm aware of an implementation considered usually quite 
conforming, which in case of failure explicitly calls "erase"!! ;-)
Are there margins in the standard for this, or you definitely advice to 
leave the string untouched in case of failure?

Thanks,
Paolo.




More information about the Libstdc++ mailing list