C++ Logo

std-proposals

Advanced search

[std-proposals] std::elide

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Mon, 15 Apr 2024 08:30:50 +0100
For the past month, I've been considering whether we should:

    (A) Add a new standard library class, std::elide

Or:

    (B) Add a new member function named "emplace_invoke" to
std::optional, std::variant

Or:

    (C) Do both A and B

A and B both allow us to do the following: Emplace an
unmovable-and-uncopyable PRvalue into an std::optional, std::variant.

The difference is that A allows us to continue to use pre-existing
code. Third party libraries, such as Boost, contain header files which
have code that uses the original 'emplace' function, and so all of
these pre-existing header files can be used without change if we opt
for A.

Since A can do everything that B can do, there is no need to also
implement B -- although I don't object to simply having it as an
alternative. But for the sake of not making the Standard any bigger
than it needs to be, perhaps just go for A by itself.

So here's the latest paper which I'm considering getting a PxxxxR0 number for:

    http://www.virjacode.com/papers/elide.htm

Received on 2024-04-15 07:31:04