2 ms·
Because that name is too verbose for regular use. People would hate it and make their own ad hoc nicknames for it not to have to type eol_flush: // ef -> st
by kazinator 11y ago
Because that name is too verbose for regular use. People would hate it and make their own ad hoc nicknames for it not to have to type eol_flush:
// ef -> std::eol_flush
template class <typename X, typename Y> basic_ostream<X, Y> &ef(basic_ostream <X, Y> &os)
{
return std::eol_flush(&os);
}
A four-letter name could have been found with better mnemonic value covering the full semantics. We can look toward assembly languages for inspiration: they pack a lot into one, two, three or four letters. For instance std::nlfl (add NewLine and FLush).
It's been years since I used C++ iostreams. I totally forgot that endl also flushes. When I saw this submission, my reaction was: what is this fuss about. Then "oh, right! That endl manipulator flushes, even on a fully buffered stream!". The name didn't remind me of this at all; but "nlfl" would almost certainly have served that purpose.