Copy Constructors and reference objects

Started by
10 comments, last by Rattenhirn 11 years ago

Thanks for the help all, I think a new implementation is in order for me, one with fewer reference data members.

I think I'll also think through my examples a bit better next time. ;)

I'm working on a game! It's called "Spellbook Tactics". I'd love it if you checked it out, offered some feedback, etc. I am very excited about my progress thus far and confident about future progress as well!

http://infinityelephant.wordpress.com

Advertisement

Rattenhirn is probably overlooking the mistake you likely made in your code where Some_Other_Class(first); does not create an unnamed temporary object, but a default constructed named object called first. I don't believe that is what you intended, and what Rattenhirn assumed.

Under the assumption that you intended to create a second object with a reference to the first object, then his explanation is correct.

ZOMG, totally missed that one. I learn something new every day!

This topic is closed to new replies.

Advertisement