What\'s the equivalent to the following:
std::vector vec;
vec.push_back(NULL);
when dealing with boost::shared_ptr
Well, this is legal:
shared_ptr foo; /* don't assign */
And in this state, it doesn't point to anything. You can even test this property:
if (foo) {
// it points to something
} else {
// no it doesn't
}
So why not do this:
std::vector < shared_ptr > vec;
vec.push_back (shared_ptr); // push an unassigned one