C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Named Return Value Optimisation [[nrvo]]

From: Barry Revzin <barry.revzin_at_[hidden]>
Date: Mon, 9 Feb 2026 17:40:49 -0600
On Mon, Feb 9, 2026 at 4:35 PM Thiago Macieira via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On Monday, 9 February 2026 14:22:02 Pacific Standard Time Jason McKesson
> via
> Std-Proposals wrote:
> > Do we really need 6-9 keystrokes just for a keyword? What you're
> > talking about aren't attributes anymore; they're just namespaced
> > keywords (and thus cannot conflict with existing code).
>
> There's a reason alignas(X) is not [[alignas(X)]] (unlike
> [[gnu::aligned(x)]]).


And that reason has nothing to do with the alleged ignorability of
attributes.

It was originally [[align(X)]]. It only changed because C didn't have
attributes yet and was pursuing _Align(...), so C and C++ unified on
_Alignas(...) and alignas(...). That's why it's in the spot it's at, and
why [dcl.align] (not alignas) is under [dcl.attr].

We didn't need a new keyword for aligning anymore than we needed a new
keyword for overriding.

Barry

Received on 2026-02-09 23:41:10