From 2ad00c88951bdffe36a22db80f7a7c233b9d8fd1 Mon Sep 17 00:00:00 2001 From: Brett Date: Fri, 21 Apr 2023 21:39:34 -0400 Subject: [PATCH] hopefully finally fix vectors --- include/blt/math/vectors.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/blt/math/vectors.h b/include/blt/math/vectors.h index 53fd33a..528ae32 100644 --- a/include/blt/math/vectors.h +++ b/include/blt/math/vectors.h @@ -25,7 +25,7 @@ namespace blt { template struct vec { - protected: + private: T elements[size]{}; public: @@ -39,14 +39,18 @@ namespace blt { elements[i] = *(args.begin() + i); } - explicit vec(const T elem[], uint32_t v_size) { - for (uint32_t i = 0; i < v_size; i++) + explicit vec(const T elem[size]) { + for (uint32_t i = 0; i < size; i++) elements[i] = elem[i]; } - vec(const vec& copy): vec(copy.elements, size) {} + vec(const vec& copy): vec(copy.elements) {} + template - vec(const vec& copy): vec(copy.elements, size) {} + explicit vec(const vec& copy) { + for (uint32_t i = 0; i < o_size; i++) + elements[i] = copy[i]; + } vec& operator=(const vec& copy) { if (© == this)