vector comparison fix 2
This commit is contained in:
parent
29ea2927e3
commit
c8656a351b
2 changed files with 12 additions and 8 deletions
|
|
@ -292,19 +292,20 @@ namespace Crafter {
|
|||
}
|
||||
}
|
||||
|
||||
template <typename BT>
|
||||
constexpr bool operator==(BT b) const {
|
||||
for(std::uint32_t i = 0; i < Len; i++) {
|
||||
if(this->v[i] != b->v[i]) {
|
||||
template <typename BT, std::uint32_t Blen, std::uint32_t BAlignment>
|
||||
constexpr bool operator==(Vector<BT, Blen, BAlignment> b) const {
|
||||
for(std::uint32_t i = 0; i < std::min(Len, Blen); i++) {
|
||||
if(this->v[i] != b.v[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
template <typename BT>
|
||||
constexpr bool operator!=(BT b) const {
|
||||
for(std::uint32_t i = 0; i < Len; i++) {
|
||||
if(this->v[i] != b->v[i]) {
|
||||
|
||||
template <typename BT, std::uint32_t Blen, std::uint32_t BAlignment>
|
||||
constexpr bool operator!=(Vector<BT, Blen, BAlignment> b) const {
|
||||
for(std::uint32_t i = 0; i < std::min(Len, Blen); i++) {
|
||||
if(this->v[i] != b.v[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,4 +22,7 @@ int main() {
|
|||
// }
|
||||
|
||||
// return 0;
|
||||
|
||||
|
||||
std::cout << (Vector<float, 3, 0>(5, 0, 0) == Vector<float, 3, 0>(5,0,1)) << std::endl;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue