Add nodiscard to core math classes to catch c++ errors.
A common source of errors is to call functions (such as round()) expecting them to work in place, but them actually being designed only to return the processed value. Not using the return value in this case in indicative of a bug, and can be flagged as a warning by using the [[nodiscard]] attribute.
This commit is contained in:
@ -33,7 +33,7 @@
|
||||
|
||||
#include "core/math/rect2.h" // also includes vector2, math_funcs, and ustring
|
||||
|
||||
struct Transform2D {
|
||||
struct _NO_DISCARD_ Transform2D {
|
||||
// Warning #1: basis of Transform2D is stored differently from Basis. In terms of elements array, the basis matrix looks like "on paper":
|
||||
// M = (elements[0][0] elements[1][0])
|
||||
// (elements[0][1] elements[1][1])
|
||||
|
||||
Reference in New Issue
Block a user