C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Return Value Optimisation whenever you need it (guaranteed elision)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sat, 12 Aug 2023 08:43:27 -0700
On Saturday, 12 August 2023 08:33:27 PDT Thiago Macieira via Std-Proposals
wrote:
> So I'll help. Of what it provided, this is the only one that is a currently
> accepted and acceptable syntax:
>
> int nrvo monkey;
>
> With nrvo being a new keyword, possibly context-sensitive like final and
> override.

You know what would help here? Not having a new keyword. So if we could reuse
an existing keyword in a way that it can't today be used, it could convey the
meaning we need.

And there is such a keyword: return.

int return monkey;

This would probably require that the keyword not appear in the first position,
so as to not be confused for a return statement.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-08-12 15:43:29