So i have this class CVector which looks a little like this
class CVector
{
const CVector& operator=(const CVector& right)
{
X = right.X;
Y = right.Y;
Z = right.Z;
return *this;
}
const CVector& operator |=(const float length) const
{
return *this = ( *this | length );
}
float X, Y, Z;
}
and im getting the following error
c:\nebula studios\project s\game\game\vec tor.h(121) : error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const CVector' (or there is no acceptable conversion)
c:\nebula studios\project s\game\game\vec tor.h(13): could be 'const CVector &CVector::opera tor =(const CVector &)'
while trying to match the argument list '(const CVector, const CVector)'
thrown by the line
return *this = ( *this | length );
i dont know if its the line itself or the assignment operator, from wat i understand it should work.
class CVector
{
const CVector& operator=(const CVector& right)
{
X = right.X;
Y = right.Y;
Z = right.Z;
return *this;
}
const CVector& operator |=(const float length) const
{
return *this = ( *this | length );
}
float X, Y, Z;
}
and im getting the following error
c:\nebula studios\project s\game\game\vec tor.h(121) : error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const CVector' (or there is no acceptable conversion)
c:\nebula studios\project s\game\game\vec tor.h(13): could be 'const CVector &CVector::opera tor =(const CVector &)'
while trying to match the argument list '(const CVector, const CVector)'
thrown by the line
return *this = ( *this | length );
i dont know if its the line itself or the assignment operator, from wat i understand it should work.
Comment