4 ms·
>Nothing about "endl" screams "this flushes", which is why nobody uses it. Are you seriously suggesting no one uses std::endl? A simple search on Github actual
by Kranar 4y ago
>Nothing about "endl" screams "this flushes", which is why nobody uses it.
Are you seriously suggesting no one uses std::endl? A simple search on Github actually reveals the opposite... almost everyone uses std::endl and almost no one uses std::flush (94% use std::endl, and 6% use std::flush).
I am also in the std::endl camp and find it absurd when people bike shed over it. It's the most intuitive/least surprising behavior (based on Stack overflow questions) and how almost all other mainstream languages behave (flush on new line), and as such it should be the default choice.
The use of ... << '\n' << std::flush is best when you want to explicitly call out that behavior because of performance reasons or some other exceptional circumstance.