C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::elide

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Fri, 31 May 2024 13:31:29 +0100
On Fri, May 31, 2024 at 12:21 PM Matthew Taylor wrote:
>
> > But let's say that the C++ programming language were
> > to be augmented in C++26 to allow us to write a function
> > that accepts a PRvalue as an argument as follows:
>
> I'd agree with Gašper that that would definitely not happen for C++26.


Well it wouldn't be Friday if I didn't write a new paper so here goes:

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

If that ever happens, it will be no sooner than C++29, so for the time
being we can focus instead on the implementation of "std::elide".

I think it will be easy to agree on an implementation of "std::elide",
I'm happy to add the functor operator requested by Gašper so that
eliders can be chained. I think the thing we will debate is the change
to the core language. Some how, some way, we need to prevent the
instantiation of template constructors which a sole parameter type of
a specialisation of "std::elide". So far there are three proposed ways
of doing this:

(1) Don't disallow the instantiation of template constructors.
(2) Add one small paragraph to the Standard to say that the
instantiation of template constructors will fail if the sole parameter
type is a specialisation of std::elide.
(3) Add to the language "template instantiation failure guides" as I
mentioned in a previous post.

Received on 2024-05-31 12:31:43