C++ Logo


Advanced search

Re: [std-proposals] std::elide

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Tue, 12 Mar 2024 19:29:57 +0000
On Mon, 11 Mar 2024 at 12:07, Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]> wrote:
> On Sun, Mar 10, 2024 at 5:40 PM Jens Maurer wrote:
> >>
> > > Okay you have me here: If we're going to add 'elide_t' to the
> >> standard library then why not just add a method called
> >> 'emplace_invoke' to optional, variant, any, vector, etc. -- which
> >> would do away with the need for 'elide_t'.
> >
> > Yes.
> I haven't decided yet whether 'std::elide' should be scrapped in
> favour of 'std::optional::emplace_invoke', or even if the both of them
> could possibly co-exist, but for the time being I've updated the paper
> as follows:
> (1) The change to the core language is now in 'temp.deduct.general'
> (2) I removed 'apply_perfectly' because 'apply' works fine here
> with an Rvalue tuple
> (3) I've beefed out the explanation of AwkwardClass's template constructor
> Here it is:
> http://www.virjacode.com/papers/elide.htm

I would drop all the times you say the changes are small, and the
count of how many words you want to add to the core language section.
The number of words is not very relevant for judging the
implementation difficulty, nor how far-reaching or disruptive a change

N.B. emplace_invoke is a thing that almost exists in the standard
already, but not exposed to users directly.

The non-propagating-cache impl detail has an emplace_deref member:

And you can get similar effects to emplace_invoke using
std::optional::transform which constructs an optional from the result
of an invocable. So implementations kind of need to have the
functionality of emplace_invoke present in std::optional already.

> And also it's attached to this email.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-03-12 19:31:14