Copy constructor, why in return by value functions

Posted by fsdfa on Stack Overflow See other posts from Stack Overflow or by fsdfa
Published on 2010-04-25T07:48:17Z Indexed on 2010/04/25 7:53 UTC
Read the original article Hit count: 215

Filed under:
|
|
|

Suppose i have: http://pastebin.com/FSnzYFFx

Then I'll get a compile error in the last line. But if I add 'const' before 'A&', its ok.

I want to know why. Where it's exactly the problem? I dont get why it should be const.

Language: C++

© Stack Overflow or respective owner

Related posts about const

Related posts about copy