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.

posted @ 2019-02-21 11:36  FigureSkating  阅读(112)  评论(0编辑  收藏  举报