Date: Wed, 24 Jan 2024 16:35:27 +0100
This has already been proposed in P1046: Automatically Generate More
Operators, although with explicit = default. It didn't go further than
allowing defaulting ->.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1046r2.html
I like the idea, but a strong reason against it is that you can also
default operator++(int) in terms of operator+, with no prefix
increment involved. You'd have to make a very strong case for
hardcoding a specific implementation in the core language instead of
letting the user decide.
Operators, although with explicit = default. It didn't go further than
allowing defaulting ->.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1046r2.html
I like the idea, but a strong reason against it is that you can also
default operator++(int) in terms of operator+, with no prefix
increment involved. You'd have to make a very strong case for
hardcoding a specific implementation in the core language instead of
letting the user decide.
Received on 2024-01-24 15:35:40