🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: A better experimental::scope_exit

#1030
From: Ross Finlayson
Date: Tue, 24 Nov 2026 20:48
48 lines
3704 bytes
On 11/24/2026 12:18 PM, Tristan Wibberley wrote:
> On 24/11/2026 19:22, Ross Finlayson wrote:
>> destructors should have no side effects (that can throw)
>
> That's merely a deduction from contensive ontology which, as you know,
> is typically a matter of fantasy: 'I call them "destructor" therefore
> they should not throw'. But their extensional properties are of things
> that can throw: "Throwing in them can mean the right thing therefore
> they may throw".
>
> In fact they're scope-hooks at the same time so which of the succeeding
> program addresses (Dijkstra) should run after they run and in which
> conditions is the important question: "all of them all of the time" is
> not correct.
>

That's agreeable as to that it seems sensible,
though, for whether it's "made sense",
besides, "makes sense".


Sometimes a "C++-minus" is going to be safer than "C++ any-which-way".

Like you said about exception-translation, exception-translation is a
first-class sort of account about a convention, since neither the
language nor the compiler otherwise says, i.e., it's "undefined".

I.e., either you make exception-translation or you don't, then
also has the usual account that the destructor's function that
throws mid-function exits the function and leaves with the
thread-of-control, as it were, unfinished the destructor-body.

Otherwise the usual account of exception throwing as "roll up all
the automatics, like any other account of exiting block and function
scope, until the exception is caught", is most what it says.


What's defined is when "dtors run once for each ctor in reverse-order
however which way the function exits, or the thread of it the function
departs", according to the language what the compiler must generate as code.

Of course it matters not so much what I say as what it is,
then that the written account speaks for itself in a particularly
sort of durable, irrepudiable statement.

Thanks for writing, good luck in your endeavors.

Technical Details
Message-ID: <o9CdnQuwLJKNZZj2nZ2dnZfqn_GdnZ2d@giganews.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!local-1.nntp.ord.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
References: <11dsk17$8ske$2@raubtier-asyl.eternal-september.org> <11e2kpl$2cc7p$1@dont-email.me> <11e39t7$2ia0c$1@raubtier-asyl.eternal-september.org> <11e40mr$2qdb1$1@dont-email.me> <11e45ce$2s6qc$1@raubtier-asyl.eternal-september.org> <11e4n3d$33ipm$1@dont-email.me> <AF-dnZwPEcxqfpj2nZ2dnZfqnPidnZ2d@giganews.com> <11e4rek$351uk$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!local-1.nntp.ord.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 24 Nov 2026 20:48:16 +0000
Subject: Re: A better experimental::scope_exit
Newsgroups: comp.lang.c++
References: <11dsk17$8ske$2@raubtier-asyl.eternal-september.org>
 <11e2kpl$2cc7p$1@dont-email.me>
 <11e39t7$2ia0c$1@raubtier-asyl.eternal-september.org>
 <11e40mr$2qdb1$1@dont-email.me>
 <11e45ce$2s6qc$1@raubtier-asyl.eternal-september.org>
 <11e4n3d$33ipm$1@dont-email.me>
 <AF-dnZwPEcxqfpj2nZ2dnZfqnPidnZ2d@giganews.com>
 <11e4rek$351uk$1@dont-email.me>
From: Ross Finlayson <ross.a.finlayson@gmail.com>
Date: Tue, 24 Nov 2026 12:48:34 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <11e4rek$351uk$1@dont-email.me>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <o9CdnQuwLJKNZZj2nZ2dnZfqn_GdnZ2d@giganews.com>
Lines: 48
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-pQoJTiRtNeP5dfBFSfBNYpmSxrztSOZl1UK8VmetJ4kp/bVv1KoslISKDT3rRCjZuB8ndIKlim4K0yj!rLloqHBG0kJAp5y4mUy9SCuUI7WMI53hDlwLnKTIZn6HLS6AxE8NwzFdeajdk6K1LNyTQ3Z1DTB8
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40