When using std::cerr, the output is not buffered, and so std::endl is redundant. When using std::cout, you should only use std::endl as well when you explicitly need a flush, which is not often the case (i.e., normally, there isn't a good reason to use it)
should be
When using std::cerr, the output is not buffered, and so std::endl is redundant. When using std::cout, you should only use std::endl as well when you explicitly need a flush, which is not often the case (i.e., normally, there isn't a good reason to use it)