[Patch] Fix exception unsafety of __numpunt_cache

Benjamin Kosnik bkoz@redhat.com
Mon Nov 24 21:01:00 GMT 2003


>... 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



More information about the Libstdc++ mailing list