3 ms·
>You assume "ending the line" means only "move to the next line". But "ending the line" could just as easily mean "ensure the line reaches its destination". Be
by smitherfield 11y ago
>You assume "ending the line" means only "move to the next line". But "ending the line" could just as easily mean "ensure the line reaches its destination".
Besides the other suggestions, I'd say something like std::eof_nl would make that interpretation a lot more obvious. Although like others I'd question the need for it at all as opposed to just an explicit "\n" << std::flush .
>Bike shedding.
I don't think anything is "bike shedding" when it comes to defining the standard library of a programming language (especially one for which all updates to the standard must maintain 100% backwards compatibility).
(Not) choosing descriptive identifiers might not have the glamour of defining semantics or optimizing performance, but it can have huge real-world implications.
The (std::endl == "\n") misconception is enormously widespread even amongst experienced C++ people, and is one of the most common sources of performance issues with the language.
- jjnoakes 11y agoYou would propose std::eof_nl and have it not mean "end of file something"? > [std::endl] is one of the most common sources of performance issues with the language. Citation needed.