Add interval equality comparison operators
This commit is contained in:
parent
2a04f0d421
commit
7155aa49e8
1 changed files with 12 additions and 0 deletions
|
|
@ -239,6 +239,18 @@ namespace psemek::geom
|
||||||
return *this = *this | i;
|
return *this = *this | i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
bool operator == (interval<T> const & i1, interval<T> const & i2)
|
||||||
|
{
|
||||||
|
return i1.min == i2.min && i1.max == i2.max;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
bool operator != (interval<T> const & i1, interval<T> const & i2)
|
||||||
|
{
|
||||||
|
return !(i1 == i2);
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T clamp(T x, interval<T> const & i)
|
T clamp(T x, interval<T> const & i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue