point: add equality operator

This commit is contained in:
Danny Robson 2014-12-19 14:59:50 +11:00
parent 1bb4c752f1
commit 58aeeb1786
2 changed files with 14 additions and 0 deletions

View File

@ -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>
void

View File

@ -56,6 +56,9 @@ namespace util {
point<S,T> operator+ (const vector<S,T>&) const;
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;
void sanity (void) const;