Have you ever hoped that C++ would have digit separators? That you wouldn’t have to strain your eyes when reading 2147483647 (is it std::numeric_limits<int32_t>::max(), or is it just similar)? That you wouldn’t have to count the zeros 5 times when typing 1000000000?
Well, the C++ Standards Committee doesn’t have your back. Oh, sure, they have introduced a digit separator, – ‘, but it’s completely unusable in production code! Here’s why.
A few weeks ago Gynvael Coldwind announced a contest (I’m sorry, the link is in Polish) related to his excellent OS dev streams (again, in Polish, but if you do understand it, definitely consider watching them). The task was simple: make a BIOS-bootable diskette image with the prettiest graphical effect; all in 16-bit text mode, with binary size limit of 512 bytes.
Every now and then I see people writing C++ code containing heresy in the vein of the following:
This is no more legal C++ than
const int qux = 42;
int * quux = &qux;
It is not undefined, unspecified or implementation defined! It is simply illegal
The following is a legit, albeit a little obscure, C89 program. It is also a legit C++11 (and above) program.
auto a = 42;
Consider the following declaration
It’s artificial (generated with the ever-helpful geordi bot), although I’m sure that if you looked hard enough, a similar one would appear somewhere in the wild. In the above case, foo is a pointer to function taking pointer to function taking char* and char* and returning int returning pointer to array of char*. I think that even seasoned C and C++ programmers will agree that this is quite confusing at first glance. Or second. And third. Especially for people less versed in “C gibberish”, as cdecl.org aptly calls it.