M
Matthew Polder
Hi,
When a class Apple is written and the assignment operator is not
explicitly declared, the operator
Apple& operator=(const Apple&)
is created by the compiler. Is there any difference between this and
const Apple& operator=(const Apple&)
other than the second form means that you can't do this:
Apple a, b, c;
//Assume there is a function 'Apple operator+(const Apple&, const
Apple&)'
(a + b) = c; //not allowed with second assignment operator, I think.
thanks,
matthew
--
Please remove the word 'tuna' from my name and add a dot j dot ('.j.')
for my correct email address. If you are a spammer please add the word
"Istink" after the word tuna.
When a class Apple is written and the assignment operator is not
explicitly declared, the operator
Apple& operator=(const Apple&)
is created by the compiler. Is there any difference between this and
const Apple& operator=(const Apple&)
other than the second form means that you can't do this:
Apple a, b, c;
//Assume there is a function 'Apple operator+(const Apple&, const
Apple&)'
(a + b) = c; //not allowed with second assignment operator, I think.
thanks,
matthew
--
Please remove the word 'tuna' from my name and add a dot j dot ('.j.')
for my correct email address. If you are a spammer please add the word
"Istink" after the word tuna.