// vec.h #ifndef VEC_H #define VEC_H #include #include #include template class Vec { private: std::vector data; public: Vec() = default; Vec(const std::vector& values) : data(values) {} // Vector-Vector Operations Vec operator+(const Vec& other) const; Vec operator-(const Vec& other) const; Vec operator*(const Vec& other) const; Vec operator/(const Vec& other) const; Vec operator%(const Vec& other) const; // Vector-Scalar Operations Vec operator+(T scalar) const; Vec operator-(T scalar) const; Vec operator*(T scalar) const; Vec operator/(T scalar) const; Vec operator%(T scalar) const; // Utility void print() const; size_t size() const { return data.size(); } // Friend scalar-vector operations friend Vec operator+(T scalar, const Vec& vec) { return vec + scalar; } friend Vec operator-(T scalar, const Vec& vec); friend Vec operator*(T scalar, const Vec& vec) { return vec * scalar; } friend Vec operator/(T scalar, const Vec& vec); friend Vec operator%(T scalar, const Vec& vec); }; #endif