C++ Logo


Advanced search

Re: Some feedback on scope guards

From: Andrey Semashev <andrey.semashev_at_[hidden]>
Date: Fri, 14 Apr 2023 03:37:38 +0300
On 4/14/23 03:14, Jason McKesson via Std-Discussion wrote:
> Plus, C++23 is getting `std::expected`, which now makes "return
> unexpected(...);" into the conceptual equivalent of a *failure* state.
> As far as the language is concerned, this is a success. But as far as
> the idea of what `std::expected` is doing, it is a failure.
> So it's really questionable what `scope_success/fail` means these days.

Hence my suggestion to make the scope guard condition customizable.

Received on 2023-04-14 00:37:51