remove union data

This commit is contained in:
BlackMATov
2020-11-23 06:39:06 +07:00
parent ad55131316
commit a14f719e21
11 changed files with 170 additions and 167 deletions

View File

@@ -7,7 +7,9 @@
#pragma once
#include "vmath_fwd.hpp"
#include "vmath_vec.hpp"
#include "vmath_vec_fun.hpp"
namespace vmath_hpp::detail
{
@@ -220,34 +222,3 @@ namespace vmath_hpp
l.swap(r);
}
}
namespace vmath_hpp
{
template < typename T, std::size_t Size >
constexpr bool operator==(const mat<T, Size>& l, const mat<T, Size>& r) {
for ( std::size_t i = 0; i < Size; ++i ) {
if ( !(l[i] == r[i]) ) {
return false;
}
}
return true;
}
template < typename T, std::size_t Size >
constexpr bool operator!=(const mat<T, Size>& l, const mat<T, Size>& r) {
return !(l == r);
}
template < typename T, std::size_t Size >
constexpr bool operator<(const mat<T, Size>& l, const mat<T, Size>& r) {
for ( std::size_t i = 0; i < Size; ++i ) {
if ( l[i] < r[i] ) {
return true;
}
if ( r[i] < l[i] ) {
return false;
}
}
return false;
}
}