2 ms·
I recently had to do some C++ again, and the amount of weird pitfalls and annoying corner cases is really starting to get to me. For example, std::cout << std::
by nikanj 11y ago
I recently had to do some C++ again, and the amount of weird pitfalls and annoying corner cases is really starting to get to me. For example, std::cout << std::hex << myNumber prints the number in hex as expected. Well, if the number has 16 bits or more. Eight-bit integers are an alias of char, and std::hex does wrong things if you feed it a char.
There probably is a workaround for this, as there is a workaround for every other "feature" too, but the more seldom I write C++, the more I realize the language could really use a streamlining. Programming languages are weird, as they seem to develop more, not less, rough patches and glitches as they age.