point: add equality operator
This commit is contained in:
parent
1bb4c752f1
commit
58aeeb1786
11
point.cpp
11
point.cpp
@ -124,6 +124,17 @@ util::point<S,T>::to (const point<S,T> &rhs) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
template <size_t S, typename T>
|
||||||
|
bool
|
||||||
|
util::point<S,T>::operator== (const util::point<S,T> &rhs) const
|
||||||
|
{
|
||||||
|
return std::equal (std::begin (this->data),
|
||||||
|
std::end (this->data),
|
||||||
|
std::begin (rhs.data));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
template <size_t S, typename T>
|
template <size_t S, typename T>
|
||||||
void
|
void
|
||||||
|
@ -56,6 +56,9 @@ namespace util {
|
|||||||
point<S,T> operator+ (const vector<S,T>&) const;
|
point<S,T> operator+ (const vector<S,T>&) const;
|
||||||
point<S,T>& operator+= (const vector<S,T>&);
|
point<S,T>& operator+= (const vector<S,T>&);
|
||||||
|
|
||||||
|
// logical operators
|
||||||
|
bool operator== (const point<S,T>&) const;
|
||||||
|
|
||||||
template <size_t D> point<D,T> redim (void) const;
|
template <size_t D> point<D,T> redim (void) const;
|
||||||
|
|
||||||
void sanity (void) const;
|
void sanity (void) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user