C++ Logo

std-proposals

Advanced search

Re: [std-proposals] int Func(void) noreentry(-1)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 12 Feb 2023 16:39:16 -0800
On Sunday, 12 February 2023 13:05:44 PST Frederick Virchanza Gotham via Std-
Proposals wrote:
> I'm making a similar argument here for "noreentry". Sure, we can use
> atomic_flags and atomic booleans to get the job done -- but it would
> be better if it were all managed for us behind the scenes by the
> compiler, for two reason:
> (1) Less typing for us, less thinking, it's just easier and quicker
> (2) Less chance of introducing a bug

Except that you forgot to take into account the complexity of the issue.
You're asking for something that requires a field in the object in question.
Therefore, there must be a syntax that adds this member.

This member is a mutex. And we have a syntax for declaring them and locking
them.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-02-13 00:39:19