News for hackers. Stuff that matters.
Re:C++23: The Next C++ Standard by projektfu on Tuesday July 11, 2023 @05:17PM (#36687336)
In C++, with its templates, there are only a couple alternatives:

1. Operator overloading

2. Operator desugaring (e.g. __subscript__(), which substitutes the intrinsic function for basic types, but can also be defined for user defined types)

3. Writing templates with weird adaptors for primitive types.

Given that its design goal was to embed C, there were already operators that worked with various and mixed types. Adding (+.), etc., would have been unacceptable to the users. So, I think in general, for this language, it was good but, unfortunately, iostream made people think you should overload the behavioral expectation, too.

Re:C++23: The Next C++ Standard by duped on Tuesday July 11, 2023 @05:28PM (#36687461)
The alternative GP is advocating for is "none of the above." Meaning "operators are only defined for primitive types" which is perfectly fine when working with C.

If you wanted to use an abstraction over non primitive types for such things you would use a normal function.

Re:C++23: The Next C++ Standard by c-cube on Tuesday July 11, 2023 @07:36PM (#36688602)
But then you make built-in types special. One of the tenets of C++ is that user defined types have as much power as built-in types.
Re:C++23: The Next C++ Standard by duped on Wednesday July 12, 2023 @12:31AM (#36690501)
Built in types are special. The compiler needs to define operator precedence and certain semantics (commutativity, associativity, overflow, etc) that cannot be expressed in the type system or enforced by the interface.

The fact that it makes syntax "nicer" for user defined types is at best subjective and at worst an anti-pattern because it leads to bad compiled code and confused programmers. Function calls are unambiguous and follow the same rules as other function calls, while operator overloading does not.

Re:C++23: The Next C++ Standard by pjmlp on Wednesday July 12, 2023 @04:03AM (#36691641)
Its design goal was to repeat the author's experience having to downgrade himself from Simula to BCPL, he wasn't keen in repeating the same experience with C, when he went out to write distributed computing applications at Bell Labs.

Bjarne has given a couple of interviews on the matter.