This is absolutely not a "premature optimization." It's a simple change that doesn't harm readability (at least once the readers get used to the style) and gives you extra performance for free.
Is it premature optimization to take parameters by const& instead of by value? Of course not. So why would it be premature optimization to use '\n' instead of std::endl?
11
u/Quincunx271 Author of P2404/P2405 Feb 26 '19
This is absolutely not a "premature optimization." It's a simple change that doesn't harm readability (at least once the readers get used to the style) and gives you extra performance for free.
Is it premature optimization to take parameters by
const&instead of by value? Of course not. So why would it be premature optimization to use'\n'instead ofstd::endl?