diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-01-03 17:47:11 +0100 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-01-13 03:39:33 +0100 |
commit | bdc3f4a198c3f047389b159e67f7e6131e053ea6 (patch) | |
tree | c0f473147116e4ba0fed8cfb5f9780982b5a3c8c /src/Vector.hpp | |
parent | Fixed CMake error (diff) | |
download | AltCraft-bdc3f4a198c3f047389b159e67f7e6131e053ea6.tar AltCraft-bdc3f4a198c3f047389b159e67f7e6131e053ea6.tar.gz AltCraft-bdc3f4a198c3f047389b159e67f7e6131e053ea6.tar.bz2 AltCraft-bdc3f4a198c3f047389b159e67f7e6131e053ea6.tar.lz AltCraft-bdc3f4a198c3f047389b159e67f7e6131e053ea6.tar.xz AltCraft-bdc3f4a198c3f047389b159e67f7e6131e053ea6.tar.zst AltCraft-bdc3f4a198c3f047389b159e67f7e6131e053ea6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Vector.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Vector.hpp b/src/Vector.hpp index 0046b4a..5795db2 100644 --- a/src/Vector.hpp +++ b/src/Vector.hpp @@ -93,9 +93,17 @@ struct Vector3 { } bool operator<(const Vector3 &rhs) const { - return std::tie(x, y, z) < std::tie(rhs.x, rhs.y, rhs.z); + if (x < rhs.x) + return true; + if (rhs.x < x) + return false; + if (y < rhs.y) + return true; + if (rhs.y < y) + return false; + return z < rhs.z; } - + friend std::ostream &operator<<(std::ostream &os, const Vector3 &vector3) { os << vector3.x << ", " << vector3.y << ", " << vector3.z; |