C++ Logo

std-proposals

Advanced search

[std-proposals] statement expressions (was: "once" keyword)

From: Alejandro Colomar <alx.manpages_at_[hidden]>
Date: Wed, 24 May 2023 18:30:12 +0200
Hi Sebastian,

On 5/24/23 18:26, Sebastian Wittmeier via Std-Proposals wrote:
> Perhaps something related to the proposed and actively discussed do expressions?
>
> Or they provide already enough functionality for your use case?
>
>
> https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2806r1.html
>
> https://github.com/cplusplus/papers/issues/1462

Hmm, how about statement expressions? They have been a GNU extension
since forever, and are very useful. I use them all the time in C for
writing safe macros.

<https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html>

I'd love to see those standardized, at least in ISO C, and hopefully
also in C++.

Cheers,
Alex

Received on 2023-05-24 16:30:15