point: add self-division operator
This commit is contained in:
parent
38d3fc1961
commit
60f2a7e00d
13
point.cpp
13
point.cpp
@ -53,6 +53,19 @@ util::point<S,T>::operator* (T f) const {
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <size_t S, typename T>
|
||||
util::point<S,T>&
|
||||
util::point<S,T>::operator/= (T f)
|
||||
{
|
||||
std::transform (std::begin (this->data),
|
||||
std::end (this->data),
|
||||
std::begin (this->data),
|
||||
[f] (auto i) { return i / f; });
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <size_t S, typename T>
|
||||
util::point<S,T>
|
||||
|
Loading…
Reference in New Issue
Block a user