Copy Constructor with Container of Pointers?

Started by
10 comments, last by SiCrane 13 years, 4 months ago
Quote:Original post by rip-off
Of course. The CRTP solution is just automating that.


Nice. It's just with my current situation it'd probably be more of a hassle to add the CRTP in at this point.

Quote:Original post by rip-off
The copy constructor is a constructor. In C++, constructors don't call each other. At least within a single class they cannot, base class constructors will be invoked implicitly if they are not called via initialiser list.


I'm learning a lot from this project ^_^. It's actually the first time I've bothered making copy constructors...

Quote:Original post by rip-off
No, sounds reasonable to me.


Alright, I'll do it that way then. Should be no problems from here on.

Thanks all.
Advertisement
Quote:Original post by rip-off
The copy constructor is a constructor. In C++, constructors don't call each other. At least within a single class they cannot, base class constructors will be invoked implicitly if they are not called via initialiser list.

Note that this will change in the next version of the C++ standard, which has quite a few changes for constructors in store. C++0x allows for constructors to call peer constructors, but such calls must be explicit. By default no constructor will call other constructors, you have to tell it to call another constructor in the member initialization list.

This topic is closed to new replies.

Advertisement