diff options
author | lawnjelly <lawnjelly@gmail.com> | 2022-01-19 19:46:17 +0000 |
---|---|---|
committer | lawnjelly <lawnjelly@gmail.com> | 2022-01-20 13:07:49 +0000 |
commit | b411a731fef9af1c0a73e4d5b718e5a6b12af1c2 (patch) | |
tree | aae207a63b24f823efef9901e92b5222e2f3618b /core/math/quaternion.h | |
parent | 249c60e9d1aacd07d87786db8059f30aed02bb68 (diff) | |
download | redot-engine-b411a731fef9af1c0a73e4d5b718e5a6b12af1c2.tar.gz |
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.
Diffstat (limited to 'core/math/quaternion.h')
-rw-r--r-- | core/math/quaternion.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/quaternion.h b/core/math/quaternion.h index cf3762e090..2575d7d229 100644 --- a/core/math/quaternion.h +++ b/core/math/quaternion.h @@ -36,7 +36,7 @@ #include "core/math/vector3.h" #include "core/string/ustring.h" -class Quaternion { +class _NO_DISCARD_ Quaternion { public: union { struct { |