Add class assingment functions

This commit is contained in:
Erik Hofman 2016-11-16 13:33:51 +01:00
parent 43bd1b15ee
commit 6bf864babb

View File

@ -42,6 +42,14 @@ public:
vec[3] = v[3]; vec[3] = v[3];
} }
float (&ptr(void))[4] {
return vec;
}
inline const float (&ptr(void) const)[4] {
return vec;
}
inline simd4_t& operator=(float f) inline simd4_t& operator=(float f)
{ {
vec[0] = vec[1] = vec[2] = vec[3] = f; vec[0] = vec[1] = vec[2] = vec[3] = f;
@ -57,6 +65,15 @@ public:
return *this; return *this;
} }
inline simd4_t& operator=(const simd4_t& v)
{
vec[0] = v[0];
vec[1] = v[1];
vec[2] = v[2];
vec[3] = v[3];
return *this;
}
inline simd4_t operator-() inline simd4_t operator-()
{ {
simd4_t r(0.0f); simd4_t r(0.0f);
@ -222,6 +239,14 @@ public:
vec[3] = v[3]; vec[3] = v[3];
} }
inline double (&ptr(void))[4] {
return vec;
}
inline const double (&ptr(void) const)[4] {
return vec;
}
inline simd4_t& operator=(double f) inline simd4_t& operator=(double f)
{ {
vec[0] = vec[1] = vec[2] = vec[3] = f; vec[0] = vec[1] = vec[2] = vec[3] = f;
@ -237,6 +262,16 @@ public:
return *this; return *this;
} }
inline simd4_t& operator=(const simd4_t& v)
{
simd4_t(r);
vec[0] = v[0];
vec[1] = v[1];
vec[2] = v[2];
vec[3] = v[3];
return *this;
}
inline simd4_t operator-() inline simd4_t operator-()
{ {
simd4_t r(0.0f); simd4_t r(0.0f);