Hello, I have a vector of smart pointers and I'd like to NULL smart pointers in reverse order. Smart pointers are done with boost::shared_ptr<>, this is the code:
// List of pointers
typedef boost::shared_ptr<int> TSmart;
std::vector<TSmart> Vec;
// Make sure that everything is NULL
std::transform( Vec.rbegin(), Vec.rend(), TSmart());
I get errors for this one. What am I doing wrong? I tried to use boost::bind
std::transform( Vec.rbegin(), Vec.rend(), boost::bind<TSmart>(TSmart()));
But I still get errors. I do not want to use boost::lambda there. What is the proper way to do that?
Thanks