point: add forwarding assignment operator
This commit is contained in:
parent
e7a76081e0
commit
f0a05e06e2
11
point.hpp
11
point.hpp
@ -34,6 +34,17 @@ namespace util {
|
|||||||
{
|
{
|
||||||
using coord::base<S,T,point<S,T>>::base;
|
using coord::base<S,T,point<S,T>>::base;
|
||||||
|
|
||||||
|
// use a forwarding assignment operator so that we can let the base
|
||||||
|
// take care of the many different types of parameters. otherwise we
|
||||||
|
// have to deal with scalar, vector, initializer_list, ad nauseum.
|
||||||
|
template <typename Arg>
|
||||||
|
point&
|
||||||
|
operator= (Arg&&arg)
|
||||||
|
{
|
||||||
|
coord::base<S,T,point<S,T>>::operator=(std::forward<Arg> (arg));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
vector<S,T> to (point dst) const { return dst - *this; }
|
vector<S,T> to (point dst) const { return dst - *this; }
|
||||||
vector<S,T> from (point src) const { return *this - src; }
|
vector<S,T> from (point src) const { return *this - src; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user