diff --git a/include/mtl/vector.hpp b/include/mtl/vector.hpp index a356592..4f75508 100644 --- a/include/mtl/vector.hpp +++ b/include/mtl/vector.hpp @@ -91,6 +91,8 @@ public: ~ivector() {} ivector& operator=(ivector rhs) { + throw mtl::system_error(); + return *this; } @@ -279,6 +281,34 @@ private: public: vector() : ivector(m_arr, C) { } + + vector(const ivector& other) { + if (other.size() > C) { + return; + } + + this->assign(other.begin(), other.end()); + } + + vector(const vector& other) : ivector(m_arr, C) { + if (other.size() > C) { + return; + } + + this->assign(other.begin(), other.end()); + } + + vector& operator=(const ivector& rhs) { + this->assign(rhs.begin(), rhs.end()); + return *this; + } + + // TODO: FIX BAD ASSIGNMENT OPERATORS + vector& operator=(const vector& rhs) { + this->assign(rhs.begin(), rhs.end()); + + return *this; + } }; } // namespace mtl