C++ Logo


Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Fri, 11 Aug 2023 16:13:11 -0700
On Friday, 11 August 2023 12:46:29 PDT Frederick Virchanza Gotham via Std-
Proposals wrote:
> My paper was just to get people thinking and to get the creative juices
> flowing.

That's not what a paper is for.

The paper is to propose a change to the standard. You may have a draft paper
with an incomplete change, or multiple alternatives to be discussed, and with
that get the creative juices flowing. But that's a side-effect; the main
objective is always to propose a change.

You didn't even attempt at the main goal.

> mutex Func(void)
> {
> if ( SomeOtherFunction() )
> {
> [[nrvo]] mutex obj1;
> obj1.lock();
> return obj1;
> }
> [[nrvo]] mutex obj2;
> obj2.lock();
> return obj2;
> }

Attributes are not allowed to modify the syntactic correctness of the program.
So if the code doesn't compile today without that attribute, the presence of
the attribute can't make it compile.

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

Received on 2023-08-11 23:13:13