by hellofunk · 10y ago · 0 comments
However, sometimes endl is indeed what you want. There is nothing to "fix" here, except maybe your attitude.
This violated the principal of least surprise enough that someone made a 10 minute long video on it :) It's really hard to blame the user this time.
It was weird to ever merge two unrelated functions into something, and then name it something as cryptic as "endl". Especially when the most common case novices would encounter this would be std::cout, where terminals will automatically flush text to the screen upon receiving "\n" anyway.