C++ 11 2019-02 to 03

-Wfloat-equal:

x = 0.3
y = 0.1 + 0.1 + 0.1

x == y // false

use this compiler option to show the reason of "==" is not fit for this comparison.


Code hygiene: prevent function parameters to be re-assigned by using 'const reference' for observing parameters.

Func(Image const& img)
Func(const Image& img)


Naming conventions:

Don't stomp on their universe, and they won't stomp on your code.

原文地址:https://www.cnblogs.com/skating/p/10411413.html