This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] Fix exception unsafety of __numpunt_cache
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: pcarlini at suse dot de, libstdc++ at gcc dot gnu dot org
- Date: Mon, 24 Nov 2003 15:00:07 -0600
- Subject: Re: [Patch] Fix exception unsafety of __numpunt_cache
- Organization: Red Hat / Chicago
- References: <3FC156EA.5020608@suse.de><3FC1F7DC.3010202@unitus.it>
>... I like *much* more the version below: we early set _M_allocated in
>__numpunct_cache<_CharT>::_M_cache, in this way if any of the new
>throws, then catched by __use_cache<>::operator(), the memory is
>automatically freed by __numpunct_cache<>::~__numpunct_cache: very
>clean!
I think this will work too.
-benjamin