This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] Money_get::do_get appends?!?
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Nathan Myers <ncm at cantrip dot org>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sun, 03 Feb 2002 23:48:54 +0100
- Subject: Re: [RFC] Money_get::do_get appends?!?
- Organization: Università della Tuscia, Viterbo, ITALY
- References: <3C5D9FBF.732203D@unitus.it> <20020203224410.B21265@cantrip.org>
- Reply-to: pcarlini at unitus dot it
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.