C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Add more methods to std::initializer_list instead of overloading

From: blacktea hamburger <greenteahamburger_at_[hidden]>
Date: Mon, 12 Sep 2022 16:30:46 +0800
No, I am not joking. Why are you sure UFCS is impossible? Are there any
relevant discussions?

I do not think so, although it has problems described here
<https://brevzin.github.io/c++/2019/08/22/ufcs-custom-extension/#why-not-ufcs>
that it can be affected by newly added member functions. For newly added
private member functions, the language rules can be modified so that they
do not participate in overload resolution. And for the newly added public
member functions... There seems to be no way.

But it does do more good than bad, i.e. less functions and no need to worry
about whether x.f() or f(x) should be used.

On Sun, Sep 11, 2022 at 11:16 PM Jason McKesson via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On Sun, Sep 11, 2022 at 10:47 AM blacktea hamburger via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
> >
> > So the standard library needs a cleanup, hopefully someone will push it
> forward when the UFCS arrives.
>
> You know that UFCS is not gonna happen, right? Or was that the joke?
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2022-09-12 08:31:14