🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: A better experimental::scope_exit

#1016
From: Tristan Wibberley
Date: Mon, 23 Nov 2026 22:49
21 lines
2258 bytes
On 21/11/2026 17:22, Bonita Montero wrote:
>         if( !m_enabled )
>             return;
>         m_fn();

This might re-enter which is probably counter-intuitive for the role of
a scope guard. Setting m_enabled to false before evaluating "m_fn()"
might be better.

-- 
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: <11e2fuo$2ao9o$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!news-fra.pugleaf.net!srl.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!news-can.pugleaf.net!news-fra.pugleaf.net!srl.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: Mon, 23 Nov 2026 22:49:59 +0000
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <11e2fuo$2ao9o$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: Mon, 23 Nov 2026 22:50:01 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2449720"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/cj0blCIbXTXqSsnVil22objZMvn/TMOnAPZwdbtoYPg=="; posting-host="f3ae5d3a9839bbc9868d42f7eef6253b"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:SkxSX3D0+RBvVbnWiKTfg+tlzyk= sha256:/FbCSTygo0rCS+ztaUxubrR53FRQPJE18JRNYuoR4VM=
	sha1:YHUEKojso4DtvzQX6uiTgb6u3+s= sha256:Vi4fhZHmTt9tlysM8Pz6IIOWWCHwHc9mUFAEMwFp0Do=
Content-Language: en-GB
In-Reply-To: <11dsk17$8ske$2@raubtier-asyl.eternal-september.org>