WarpX
WarpX copied to clipboard
Replace "std::endl" with "\n" (except for error messages)
It is often preferable to use \n instead of std::endl, since the latter forces the flush of the buffer.
This PR replaces all the occurrences of std::endl with \n in WarpX.
~Warning: while I think that in most cases this is a good idea, I am not sure about error messages. I am inclined to revert to std::endl for error messages that are printed just before an abort, to make sure that they are actually printed. What do you think?~
Note: Where flushing the buffer seems intentional and useful (e.g., right before an abort or when the message is written to std::cerr), I did not replace std::endl with \n
I am inclined to revert to std::endl for error messages [...]
Agreed, please don't generally replace.
I am inclined to revert to std::endl for error messages [...]
Agreed, please don't generally replace.
@ax3l , as agreed I reverted to std::endl in cases where flushing the buffer seemed a good idea (essentially for error messages).
We can collapse a few extra
<<between string constants.
I agree. I have accepted all your suggestions!