vector: add forwarding assignment operator
This commit is contained in:
parent
d7b36b0ee3
commit
1cc4f90b52
12
vector.hpp
12
vector.hpp
@ -33,7 +33,17 @@ namespace util {
|
||||
struct vector : public coord::base<S,T,vector<S,T>>
|
||||
{
|
||||
using coord::base<S,T,vector<S,T>>::base;
|
||||
using coord::base<S,T,vector<S,T>>::operator=;
|
||||
|
||||
// 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>
|
||||
vector&
|
||||
operator= (Arg&&arg)
|
||||
{
|
||||
coord::base<S,T,vector<S,T>>::operator=(std::forward<Arg> (arg));
|
||||
return *this;
|
||||
}
|
||||
|
||||
// representations
|
||||
template <size_t D = 4>
|
||||
|
Loading…
Reference in New Issue
Block a user