C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Attribute [[discard]] and attributes on expressions

From: Julien Jorge <julien.jorge_at_[hidden]>
Date: Thu, 05 Oct 2023 23:39:12 +0200
Le 5 octobre 2023 22:03:31 GMT+02:00, Giuseppe D'Angelo via Std-Proposals <std-proposals_at_[hidden]> a écrit :
>Hello,
>
>Hoping that EWGI will reconvene in Kona, I have prepared a proposal to allow attributes on expressions, and also proposes the [[discard]] attribute. It is a draft ... of a draft -- there's still some design work to be done, possibly with EWG(I) help.
>
>https://isocpp.org/files/papers/D2992R0.html
>
>As usual, any early feedback is very much appreciated.
>

A small observation after skimming through your proposal. Attributes can be safely ignored without changing the semantics of the program, so what does it means to have a statement like `int a = foo(), [[discard]] bar()`? In any case `a` must receive the result of `foo()`, isn't it?

Julien

Received on 2023-10-05 21:39:18