News for hackers. Stuff that matters.
Re:Popular Myths about C++, Part 1 by mikeash on Tuesday December 09, 2014 @09:55AM (#8723028)
The standard library is part of the language. But that aside, the fact that + doesn't work on string literals cannot possibly be a problem with the standard library. The fact that the language lets you extend + to work with some types but not others is not a problem with the standard library.

As for initializer lists, the problem isn't simply that {} doesn't produce a vector, it's that identical-looking constructs do completely different things in different contexts. a = b can do completely different things depending on where you see it and what declarations are visible and on and on. Again, not a problem with the standard library.

The standard library suffers from these problems, as it must since it exists within the language that causes them. But the problems are not in the standard library.

Re:Popular Myths about C++, Part 1 by claudius on Tuesday December 09, 2014 @10:14AM (#8723165)
> a = b can do completely different things depending on where you see it and what declarations are visible and on and on.

I don’t see your problem with this. "a + b" certainly can and should do "completely different things depending on where you see it" and "+" is commonly used in completely different contexts in real-world usage, too, e.g. integer addition, integer addition modulo x, real number addition, complex number addition, vector addition, matrix addition, vector space addition, set addition/union etc. etc.

To restrict "+" to only act on integers (or reals?) and require a +_real, +_complex, +_vector, +_matrix etc. seems unreasonable.

Now, given that "+" may well do whatever it seems fit with its two operands, why should "=" not be allowed to do the same?