darray: add equality operators

This commit is contained in:
Danny Robson 2018-11-08 14:10:50 +11:00
parent 7e8f2df869
commit f44c7d5b46

View File

@ -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);
}
}