Hello
Im unsure how I should use smart/auto pointer in this case:
I have a vector of pairs:
Code:
std::vector<std::pair<std::string, unsigned int>
Now I want vector to be a pointer, so it would be deleted when not needed anymore..
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:
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> >));
But this wont compile..
Thanks for help
Regards