]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Use RAII in _Hashtable
authorJonathan Wakely <jwakely@redhat.com>
Fri, 1 Nov 2024 22:20:22 +0000 (22:20 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 13 Nov 2024 20:21:40 +0000 (20:21 +0000)
commitd2970e86c4de89b4ba38fa935f1be65681970c69
tree216001b8e2640deb29ded8e25fc4a1f51ca66d32
parente717c322c6ee21bd5d9cf9373dcd9b4e8ba3312f
libstdc++: Use RAII in _Hashtable

Use scoped guard types to clean up if an exception is thrown. This
allows some try-catch blocks to be removed.

libstdc++-v3/ChangeLog:

* include/bits/hashtable.h (operator=(const _Hashtable&)): Use
RAII instead of try-catch.
(_M_assign(_Ht&&, _NodeGenerator&)): Likewise.

Reviewed-by: François Dumont <fdumont@gcc.gnu.org>
libstdc++-v3/include/bits/hashtable.h