C++ Logo

std-proposals

Advanced search

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

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Fri, 6 Oct 2023 16:34:18 +0200
Hello,

On 06/10/2023 07:54, Julien Jorge wrote:
> Back to the proposal, I was confused by examples like:
>
> a[4] = (x+y [[attr]]); // attr applies to `x+y`
>
> I was wondering what does it mean to discard x+y here? From your
> explanations I understand that the attribute would be ignored here, and
> that a[4] would be assigned x+y. Which is okay for me.
>

Talking about attribute [[discard]], that would be correct, it would not
have any effect there. The example was however just showcasing the
overall syntax for attributes on expressions, and the syntactic
implications of which is the affected (sub)expression.

Thank you,
-- 
Giuseppe D'Angelo

Received on 2023-10-06 14:34:21