I see developers on web generally use:

Code:
std::cout << msg;
but they sometimes use flush:

Code:
std::cout << msg << std::flush;
What is the purpose of the std::flush? In which cases it is recommended to use?

Cheers