|
Boost : |
From: Janko Dedic (jankodedic2_at_[hidden])
Date: 2024-12-18 13:20:14
On Wed, Dec 18, 2024 at 10:12â¯AM Ivan Matek via Boost <boost_at_[hidden]>
wrote:
> Member Syntax is Better for Users
> Herb's UFCS P3021
> <https://open-std.org/JTC1/SC22/WG21/docs/papers/2023/p3021r0.pdf> has a
> list of reasons explaining this in detail. Since some people mentioned UFCS
> here before just to make clear: I am linking this paper *not* because of
> UFCS, but because it explains why
> member syntax is better for users(sections 3.1.1, 3.1.2, 3.1.3).
>
Unfortunately, the UFCS proposals have been inherently misguided, because
they are proposing something that is harder to implement, and something
that nobody actually wants. We don't really need the ability to call every
function in two different ways (other than for ADL customization points,
but those are also a way to cope with the lack of a language feature
anyway). Nobody wants to write `x.max(y)` and `starts_with(string,
prefix)`. Each function should use a spelling that makes more sense for it.
Many languages are perfectly happy with extension functions without any
"universal" syntax.
Just my two cents on the topic, to hopefully frame the discussion in the
proper way.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk