Still improving! (Was: Re: [PATCH] Avoid strtok for thread safety)

Nathan Myers ncm-nospam@cantrip.org
Wed Nov 27 09:23:00 GMT 2002


On Wed, Nov 27, 2002 at 05:11:38PM +0100, Paolo Carlini wrote:
> Martin Sebor wrote:
> 
> > Sorry for butting in, but the code above doesn't seem exception
> > safe :) (I.e., it will leak if any of the new expressions except
> > the first one throws). 
> 
> Thanks!
> 
> What about Nathan's solution? At this point I was meaning to finalize 
> *that* one, indeed:
> 
>     http://gcc.gnu.org/ml/libstdc++/2002-11/msg00297.html

Same either way.  Storing std::string instances instead of pointers
would fix it.  I don't know why Benjamin doesn't want to use them,
unless there's some include-loop problem nobody wants to tackle.

Nathan Myers
ncm-nospam@cantrip.org



More information about the Libstdc++ mailing list