C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::elide

From: Lorand Szollosi <szollosi.lorand_at_[hidden]>
Date: Sat, 25 May 2024 21:13:12 +0200
Hi,

> On 25 May 2024, at 16:24, Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> We're not.
>
> There's no semantic need to return a locked mutex because no other thread can
> have access to the mutex until the function has returned. Therefore, there's
> ample opportunity to lock the mutex after the function has returned.
>
> Returning a scoped_lock, however, makes a lot of sense.

Indeed - my point here was, if Frederick is okay with auto [v] = getLockedWhatever(); syntax, as in the example with get<> override, then getLockedWhatever can be a struct with a ctor and a public member.

Thanks,
-lorro
>

Received on 2024-05-25 19:13:26