warning C4239:nonstandard extension used : 'argument' : conversion from X to Y A reference that is not to 'const' cannot be bound to a non-lvalue; assigment operator takes a reference to non-const |
|
|
const LargeInt& x
instead of just LargeInt& x
.
|
|
class LargeInt:public ListBasicObjects<unsigned int> { public: void operator= (const LargeInt& x); void Assign(const LargeInt& x); LargeInt operator/(int x)const; LargeInt(LargeInt& x); LargeInt(){}; }; void LargeInt::operator =(const LargeInt& x) { this->Assign(x);//error C2664 here! } |
|
|
this->Assign(*this);
? In other words, what is the purpose of the const
above?const LargeInt&
.
|
|
A question related to that. With the above definition, what happens if I call this->Assign(*this);? In other words, what is the purpose of the const above? |
|
|