darray: add equality operators
This commit is contained in:
parent
7e8f2df869
commit
f44c7d5b46
@ -138,4 +138,35 @@ namespace cruft {
|
||||
|
||||
std::size_t m_size;
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <
|
||||
std::size_t SizeA, typename ValueA,
|
||||
std::size_t SizeB, typename ValueB
|
||||
>
|
||||
constexpr auto
|
||||
operator== (
|
||||
darray<SizeA,ValueA> const &a,
|
||||
darray<SizeB,ValueB> const &b
|
||||
) {
|
||||
return std::equal (
|
||||
a.begin (), a.end (),
|
||||
b.begin (), b.end ()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <
|
||||
std::size_t SizeA, typename ValueA,
|
||||
std::size_t SizeB, typename ValueB
|
||||
>
|
||||
constexpr auto
|
||||
operator!= (
|
||||
darray<SizeA,ValueA> const &a,
|
||||
darray<SizeB,ValueB> const &b
|
||||
) {
|
||||
return !(a == b);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user