mine-chad / server

MIT License
1 stars 1 forks source link

Change newline characters to `std::endl` for enhanced output control #2

Closed ghost closed 1 year ago

ghost commented 1 year ago

In this commit, I have replaced the usage of newline characters ('\n') with std::endl in our codebase. This change aims to provide better control over output handling and improve the overall code quality. Here's why this is considered a good practice:

While it's worth noting that using std::endl incurs a performance overhead due to the flushing operation, the impact is negligible in most cases. If immediate flushing is not necessary, we can still use '\n' and explicitly flush the buffer when needed using std::flush.

Overall, this commit promotes good programming practices by enhancing output control, ensuring platform independence, and improving code readability.