C++ Logo


Advanced search

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

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Wed, 24 May 2023 18:37:21 +0200
Hi Alex,   they are mentioned in § 3.7 of the cited paper as Prior Art. And are quite similar in many regards. Do you have an idea how they could be used for the use case of the OP?   Best, Sebastian   -----Ursprüngliche Nachricht----- Von:Alejandro Colomar <alx.manpages_at_[hidden]> Gesendet:Mi 24.05.2023 18:30 Betreff:statement expressions (was: [std-proposals] "once" keyword) An:std-proposals_at_[hidden]; CC:Sebastian Wittmeier <wittmeier_at_[hidden]>; 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:37:23