From 5e3180582b34ed8db878506a5f2f8a372e5af6bf Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 23 Feb 2019 14:58:43 +0100 Subject: Make childs inherit all basic_vec constructors with lang syntax --- include/mmvec.hpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/include/mmvec.hpp b/include/mmvec.hpp index 21e91b5..1939388 100644 --- a/include/mmvec.hpp +++ b/include/mmvec.hpp @@ -222,10 +222,7 @@ std::ostream& operator<<(std::ostream& os, const mm::basic_vec& v) { template class mm::vec: public mm::basic_vec { public: - vec(std::initializer_list l) : basic_vec(l) {} - - template - vec(const basic_vec& other) : basic_vec(other) {} + using mm::basic_vec::basic_vec; }; @@ -235,11 +232,7 @@ public: template class mm::vec3 : public mm::basic_vec { public: - vec3() : basic_vec() {} - vec3(std::initializer_list l) : basic_vec(l) {} - - template - vec3(const basic_vec& other) : basic_vec(other) {} + using mm::basic_vec::basic_vec; T& x() { return this->at(0); } T& y() { return this->at(1); } @@ -293,11 +286,7 @@ mm::vec3 mm::vec3::cross(const vec3& rhs, const vec3& lhs) { template class mm::vec2: public mm::basic_vec { public: - vec2() : basic_vec() {} - vec2(std::initializer_list l) : basic_vec(l) {} - - template - vec2(const basic_vec& other) : basic_vec(other) {} + using mm::basic_vec::basic_vec; T& x() { return this->at(0); } T& y() { return this->at(1); } -- cgit v1.2.1