From bbe1351923579a0c170cb57a4306c74c0c974275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Wed, 17 Jun 2015 14:02:05 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@141 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/math/pimathvector.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/math/pimathvector.h b/src/math/pimathvector.h index 6e5667d1..824e89a7 100644 --- a/src/math/pimathvector.h +++ b/src/math/pimathvector.h @@ -69,6 +69,7 @@ public: Type & operator [](uint index) {return c[index];} Type operator [](uint index) const {return c[index];} _CVector & operator =(const _CVector & v) {memcpy(c, v.c, sizeof(Type) * Size); return *this;} + _CVector & operator =(const Type & v) {PIMV_FOR(i, 0) c[i] = v; return *this;} bool operator ==(const _CVector & v) const {PIMV_FOR(i, 0) if (c[i] != v[i]) return false; return true;} bool operator !=(const _CVector & v) const {return !(*this == c);} void operator +=(const _CVector & v) {PIMV_FOR(i, 0) c[i] += v[i];} @@ -181,7 +182,8 @@ public: Type at(uint index) const {return c[index];} Type & operator [](uint index) {return c[index];} Type operator [](uint index) const {return c[index];} - void operator =(const _CVector & v) {c = v.c;} + _CVector & operator =(const _CVector & v) {c = v.c; return *this;} + _CVector & operator =(const Type & v) {PIMV_FOR(i, 0) c[i] = v; return *this;} bool operator ==(const _CVector & v) const {PIMV_FOR(i, 0) if (c[i] != v[i]) return false; return true;} bool operator !=(const _CVector & v) const {return !(*this == c);} void operator +=(const _CVector & v) {PIMV_FOR(i, 0) c[i] += v[i];}