C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::elide

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Sat, 18 May 2024 12:01:25 -0400
On Sat, May 18, 2024 at 9:49 AM Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]> wrote:

> On Mon, Apr 15, 2024 at 8:30 AM Frederick Virchanza Gotham wrote:
> >
> > A and B both allow us to do the following: Emplace an
> > unmovable-and-uncopyable PRvalue into an std::optional, std::variant.
>
> This is now P3288:
> virjacode.com/papers/p3288.htm
> [...] I'm going to try get it put to a vote at the next meeting [...]


Your "Proposed Wording" is only one sentence. It refers to something called
"std::elide," which is never defined in the wording.

Your section 1 claims that it's *not* possible to emplace a
`counting_semaphore` into an `optional`, but in fact section 2.1 shows that
it *is* possible.

The thing that's *actually* impossible in today's C++ is to return a
*mutated* immovable object, as in:
  std::mutex ReturnLockedMutex() {
    std::mutex m;
    m.lock();
    return m;
  }
and your `std::elide` idea doesn't help with that.

–Arthur

Received on 2024-05-18 16:01:40