Stratax
Scientific computing containers and operations
Toggle main menu visibility
Loading...
Searching...
No Matches
Comparison.hpp
Go to the documentation of this file.
1
2
#pragma once
3
4
#include <
stratax/core/Concepts.hpp
>
5
#include <
stratax/core/Validation.hpp
>
6
16
template
<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
47
template
<Array A>
48
[[nodiscard]]
bool
operator!=
(
const
A& lhs,
const
A& rhs)
49
{
50
return
!(lhs == rhs);
51
}
operator!=
bool operator!=(const A &lhs, const A &rhs)
Compares two array-like containers for inequality.
Definition
Comparison.hpp:48
operator==
bool operator==(const A &lhs, const A &rhs)
Compares two array-like containers for exact equality.
Definition
Comparison.hpp:17
Concepts.hpp
Validation.hpp
Shared runtime validation helpers.
stratax::core::validation::same_shape
bool same_shape(const Lhs &lhs, const Rhs &rhs)
Returns whether two array-like objects have identical size and shape.
Definition
Validation.hpp:300
include
stratax
ops
Comparison.hpp
Generated by
1.17.0