C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::elide

From: Avi Kivity <avi_at_[hidden]>
Date: Mon, 01 Jul 2024 16:48:03 +0300
I'd like to suggest an improvement to the name.

std::elide suggests we elide something, but not what we elide. Copy
elision is not elision, it's a more specific concept.

We could call id std::elide_copying, but I think it's still too
roundabout.

I'd call it std::construct_with_returning(). e.g.
std::construct_with_returning<ClassName>(arg1, args2, arg3). It's a
direct name for simple helper. In a call site

    return std::construct_with_returning<...>(...)

It's clear we're constructing a new object and what the new object's
type is.

On Sat, 2024-03-09 at 21:13 +0000, Frederick Virchanza Gotham via Std-
Proposals wrote:
> Add a new function to the standard library to make possible the
> emplacement of an unmovable-and-uncopiable prvalue into types such as
> std::optional, std::variant, std::any -- without requiring an
> alteration to the definitions of these classes.
>
> http://www.virjacode.com/papers/elide.htm
>
> Also it's attached to this email.


Received on 2024-07-01 13:48:10