I'm an Objective-C programmer, and am recently starting C++, and I've stumbled into this question on my code's organization:
std::list<char *> stuff = std::list<char *>();
thing *object = new thing(stuff);
Where stuff
would be an object that I'd need for the lifetime of my class (that is, until it gets destructed), how to avoid losing it?
On Objective-C, I could simply call -retain
on the constructor. On C++?