Stratax 0.2.0
Loading...
Searching...
No Matches
Comparison.hpp
1
2#pragma once
3
4#include <stratax/core/Concepts.hpp>
6
16template<Array A>
17[[nodiscard]] bool operator==(const A& lhs, const A& rhs)
18{
19 if (!stratax::core::validation::same_shape(lhs, rhs))
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}
52
Shared runtime validation helpers.