Stratax
Scientific computing containers and operations
Loading...
Searching...
No Matches
Comparison.hpp
Go to the documentation of this file.
1
2#pragma once
3
6
16template<Array A>
17[[nodiscard]] bool operator==(const A& lhs, const A& rhs)
18{
20 {
21 return false;
22 }
23
24 auto it1 = lhs.begin();
25 auto it2 = rhs.begin();
26 const auto end = lhs.end();
27
28 for (; it1 != end; ++it1, ++it2)
29 {
30 if (*it1 != *it2)
31 {
32 return false;
33 }
34 }
35 return true;
36}
37
47template<Array A>
48[[nodiscard]] bool operator!=(const A& lhs, const A& rhs)
49{
50 return !(lhs == rhs);
51}
bool operator!=(const A &lhs, const A &rhs)
Compares two array-like containers for inequality.
bool operator==(const A &lhs, const A &rhs)
Compares two array-like containers for exact equality.
Shared runtime validation helpers.
bool same_shape(const Lhs &lhs, const Rhs &rhs)
Returns whether two array-like objects have identical size and shape.