[RFC] basic_string: really weird try/catch blocks
Paolo Carlini
pcarlini@suse.de
Mon Jan 19 11:23:00 GMT 2004
Nathan Myers wrote:
>> try
>> { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
>> catch(...)
>> {
>> __r->_M_destroy(__a);
>> __throw_exception_again;
>> }
>
> I think this one has to stay. _S_copy_chars uses various operators
> on __beg, which may throw, in general. Probably we need some test
> cases with tetchy iteratators, to make sure the right thing happens
> when they go off.
Thanks for pointing out this! I didn't notice this tricky issue with
tetchy ("tetchy"? A new word learned every day!) iterators.
In the meanwhile I have committed the safe clean ups.
Paolo.
More information about the Libstdc++
mailing list