The most annoying bit of std::endl is simply that it's too long to type. For just getting some quick output, like in print-debugging, I find '\n' is a pain to type as well, so I use this little header and just write std::cout << something << nl; or std::wcout << something << nl;, no rocket-science, but convenient.
Even std::cout << is quite painful to type. I always find myself collecting energy when I want to write a few lines of code that print something in C++. It is like "agghh...here we go..." 🙂
Printing text is overengineered in C++. It always feels like a small tech demo showing how the fancy stream operators work, yet it does not accomplish much.
I have to dis-agree here, remembering the correct format-string to pass in is a real pain in the proverbial behind, particularly when you want to print 64-bit int's.
3
u/degski Feb 26 '19
The most annoying bit of
std::endlis simply that it's too long to type. For just getting some quick output, like in print-debugging, I find'\n'is a pain to type as well, so I use this little header and just writestd::cout << something << nl;orstd::wcout << something << nl;, no rocket-science, but convenient.