[PATCH 1/4] gdbsupport/intrusive-list: sprinkle noexcept
Keith Seitz
keiths@redhat.com
Thu Sep 12 22:49:43 GMT 2024
Hi, Simon,
On 8/12/24 10:09 AM, Simon Marchi wrote:
> The only one I had a doubt about is clear_and_dispose: what if the
> disposer throws? The boost equivalent [1] is noexcept and requires the
> disposer not to throw. The rationale is probably the same as for
> destructors. What if the disposer throws for an element in the middle
> of the list? Do you skip the remaining elements? Do you swallow the
> exception and keep calling the disposer for the remaining elements?
> It's simpler to say no exceptions allowed.
This is very thoughtful, and I agree: follow boost's lead and KISS.
Reviewed-by: Keith Seitz <keiths@redhat.com>
Keith
> [1] https://www.boost.org/doc/libs/1_79_0/doc/html/boost/intrusive/list.html#idm33710-bb
>
> Change-Id: I402646cb12c6b7906f4bdc2ad85203d8c8cdf2cc
> ---
> gdbsupport/intrusive_list.h | 86 ++++++++++++++++++-------------------
> 1 file changed, 43 insertions(+), 43 deletions(-)
More information about the Gdb-patches
mailing list