shared_ptr has operator bool(), which returns true if it is not empty.
For example, this is Microsoft implementation of shared_ptr::operator bool(): http://msdn.microsoft.com/en-us/library/bb982901.aspx
shared_ptr::operator boolean-type - Tests if an owned resource exists.