C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Stop gap required for NRVO until Anton's paper is assimilated

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Thu, 11 Jul 2024 12:22:26 -0400
On Thu, Jul 11, 2024 at 12:13 PM Tiago Freire via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> The way I see it, any other solution that is not achieving guaranteed nrvo extensions without any additional markings (this includes functions) is a waste of time.
>
> What you need is quite simple.
> Any named variable X that is returned should guarantee nrvo unless a return statement exist that does not return X and X is alive.
>
> I'm perfectly confident that the solution is this, and that this is implementable.
> Everything else is just adds clutter to the language and is an automatic no from my part.

OK, but... that's what version 1 of P2025 was, and the committee was
pretty clear:

> This paper should explore an explicit syntax to opt-into this functionality:
>
> SF: 6, F: 10, N: 3, A: 1, SA: 3
>
> Conclusion: This paper needs to explore an explicit opt-in syntax and return to EWG.

So as far as the committee is concerned, your idea was considered and rejected.

Received on 2024-07-11 16:22:40