Just learned that std::endl flushes the buffer.