[PATCH][_Hahstable] Use RAII to guard node pointer while constructing

Jonathan Wakely jwakely@redhat.com
Thu Nov 9 00:57:23 GMT 2023


On Wed, 8 Nov 2023 at 20:00, François Dumont <frs.dumont@gmail.com> wrote:
>
> Another proposal to use RAII rather than __try/__catch block.
>
> libstdc++: [_Hashtable] Use RAII type to guard node while constructing value
>
> libstdc++-v3/ChangeLog:
>
>          * include/bits/hashtable_policy.h
>          (struct _NodePtrGuard<_HashtableAlloc, _NodePtr>): New.
>          (_ReuseAllocNode::operator()(_Args&&...)): Use latter to guard
> allocated node
>          pointer while constructing in place the value_type instance.
>
> Tested under Linux x64, ok to commit ?

Looks good, OK.



More information about the Libstdc++ mailing list