Compare commits
1 Commits
sekiei
...
ef9c7ac15d
Author | SHA1 | Date | |
---|---|---|---|
ef9c7ac15d |
33
glm/gtx/spaceship.hpp
Normal file
33
glm/gtx/spaceship.hpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <compare>
|
||||||
|
#include "../detail/qualifier.hpp"
|
||||||
|
#include "../detail/setup.hpp"
|
||||||
|
|
||||||
|
namespace glm
|
||||||
|
{
|
||||||
|
template<length_t l, typename T, qualifier q>
|
||||||
|
GLM_FUNC_DECL GLM_CONSTEXPR std::strong_ordering operator<=>(const glm::vec<l, T, q>& left, const glm::vec<l, T, q>& right)
|
||||||
|
{
|
||||||
|
if (left[0] != right[0]) {
|
||||||
|
return left[0] <=> right[0];
|
||||||
|
}
|
||||||
|
if constexpr (l > 1) {
|
||||||
|
if (left[1] != right[1]) {
|
||||||
|
return left[1] <=> right[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if constexpr (l > 2) {
|
||||||
|
if (left[2] != right[2]) {
|
||||||
|
return left[2] <=> right[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if constexpr (l > 3) {
|
||||||
|
if (left[3] != right[3]) {
|
||||||
|
return left[3] <=> right[3];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return std::strong_ordering::equal;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user