Add geom::box comparison operators

This commit is contained in:
Nikita Lisitsa 2022-02-05 12:38:51 +03:00
parent d577282fce
commit 29bdfb4dd2

View file

@ -241,6 +241,21 @@ namespace psemek::geom
return *this = *this | b;
}
template <typename T, std::size_t N>
bool operator == (box<T, N> const & b1, box<T, N> const & b2)
{
for (std::size_t i = 0; i < N; ++i)
if (b1[i] != b2[i])
return false;
return true;
}
template <typename T, std::size_t N>
bool operator != (box<T, N> const & b1, box<T, N> const & b2)
{
return !(b1 == b2);
}
template <typename T, std::size_t N>
std::ostream & operator << (std::ostream & os, box<T, N> const & b)
{