🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++
Article #1017

Re: A better experimental::scope_exit

#1017
From: Tristan Wibberley
Date: Tue, 24 Nov 2026 00:12
38 lines
3377 bytes
On 21/11/2026 17:22, Bonita Montero wrote:

>     static_assert( std::is_nothrow_invocable_v<Fn> );
  The facility is here eliciting the feeling that, by using it, one may
disregard the possibility that exceptions pass out of it's members and
destructor or that exceptions passing out of the callbacks I provide to
it are unable to affect its behaviours that I intuitively expect.
  However, only Fn is tested for being nothrow invocable. There are also
::run and ::disable of the dependency node to consider.

  There is much to talk about on interface design so this would be
longwinded and annoying if I did. I wonder if it's better to work with
client callbacks that throw exceptions so the surprises of the limited
compose-ability are removed. I suppose it depends on the scale of the
development that the class is being used in.

  Does C++ still allow noexcept(false) destructors and does an exception
at the end of a destructor allow the members to be destroyed? My memory
failed in the last few years and I can't remember - I think it does but
I can't bring a justification for the belief to mind, I think I
previously relied on advice from journalists that it does.
  Then there would be some thought needed for how exceptions from m_fn()
and m_pDep::run() interact, c++ has nested exceptions now doesn't it so
a list can be collected up can't it, which would be sufficient for this
particular facility being that it's list-like.

-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Technical Details
Message-ID: <11e2kpl$2cc7p$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11dsk17$8ske$2@raubtier-asyl.eternal-september.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk>
Newsgroups: comp.lang.c++
Subject: Re: A better experimental::scope_exit
Date: Tue, 24 Nov 2026 00:12:36 +0000
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <11e2kpl$2cc7p$1@dont-email.me>
References: <11dsk17$8ske$2@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 24 Nov 2026 00:12:37 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2502905"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+EDYSa+oWJw5IM6gY4NV9qaXmTDC3gZpK2d0NilSztSw=="; posting-host="decbdae56b93c9f0180ef0a73d46de56"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:tj9zsbdMTQmBReYmI3IKBY49w+A= sha256:DPAX3gL75iH6akurrKYA9AUlGRzRU4xkZ21tv5soKoY=
	sha1:4CYVyp9CiINNSBcCzMFZnhhXpdY= sha256:Q25zrykz2qKhp3S0vFeMGv2/dj/OtMOO3RDjdko0i5Q=
In-Reply-To: <11dsk17$8ske$2@raubtier-asyl.eternal-september.org>
Content-Language: en-GB