I'm using reset()
as a default value for my shared_pointer (equivalent to a NULL
).
But how do I check if the shared_pointer is NULL
?
Will this return the right value ?
boost::shared_ptr<Blah> blah;
blah.reset()
if (blah == NULL)
{
//Does this check if the object was reset() ?
}
Use:
if (!blah)
{
//This checks if the object was reset() or never initialized
}