diff --git a/cpp/src/math.hpp b/cpp/src/math.hpp index a44638e..f6c45f7 100644 --- a/cpp/src/math.hpp +++ b/cpp/src/math.hpp @@ -46,6 +46,9 @@ public: vec(std::array array) : m_Array{array} {} + template + vec(vec&& other) : m_Array{std::move(other.m_Array)} {} + // // Access to elements & data // @@ -276,11 +279,17 @@ public: } template - vec ChangeTag() + vec ChangeTag() const & { return vec(m_Array); } + template + vec ChangeTag() && + { + return vec(std::move(*this)); + } + // Structured binding support for N == 2 template const T& get() const