This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Money_get::do_get appends?!?


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]