C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::elide

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Tue, 4 Jun 2024 22:29:42 +0100
On Tue, Jun 4, 2024 at 9:58 PM Robert A.H. Leahy wrote:
>
> No.
>
> This class should not be special cased in the core language.
>
> Old, broken classes aren't worth trying to save in this manner.
>
> Just modify, reimplement, or wrap them.


Well. . . 9 out of 10 use cases for "std::elide" are that it should
fail to be the sole parameter type of a constructor. So to satisfy
those 90+ % of use cases, we should have an "std::elide" that fails
instantiation.

For the small minority of cases, where we want it to succeed in being
the sole parameter type of a constructor, we could have
"std::elide_nofail".

And as for the reluctance to change the core language for
"std::elide", well the core language and standard library are already
tangled.... I mean it really went to an extreme with having to include
a header file to use an operator (i.e. typeid). Plus there's core
language unique treatment for std::complex.

I don't think it's a big deal that "std::elide" would get special
mention in the the description of the core language.

Received on 2024-06-04 21:29:56