Hello
Im unsure how I should use smart/auto pointer in this case:
I have a vector of pairs:
Now I want vector to be a pointer, so it would be deleted when not needed anymore..Code:std::vector<std::pair<std::string, unsigned int>
Should I make vector a smart/auto pointer, or each pair thats in vector smart/auto pointer or should I make both - vector and pairs pointers?
I tried:
But this wont compile..Code:typedef boost::shared_ptr<std::vector<std::pair<std::string, unsigned int> >> record_ptr; record_ptr = new record_ptr(new (std::vector<std::pair<std::string, unsigned int> >));
Thanks for help
Regards



LinkBack URL
About LinkBacks



CornedBee