|
|
|
|
|
by Someone
2209 days ago
|
|
“Extra careful to cover all cases is when I start looking at alternatives.“ IMO, an advantage of C++ is that, in well-written code, being extra careful is (mostly) limited to the implementer of code, not to its users. It would be nice if nobody would have to be extra careful, but that’s the price you pay for power, I fear. |
|
For example, instead of a comma operator and its overloads, you can have tuples. Then `let (a,b) = (b,a)` works as expected. If you want weird code, you can overload `vec += (1,2,3,4,5)` with a tuple, and that's a straightforward case with no hidden gotchas.