std::shared_ptr<B> ptr1 = b;
std::shared_ptr<B> ptr2 = b;
//somewhere in my code
int index = someindex;
if ( !b[index].get()->isAlive() )
if ( b[index].use_count() == 1 )
what i did here is have share_ptrs in one object, and then in the middle of program i constantly check if isAlive() will return true, and then if its false im just going to wait until other shared_ptr that manages it destroyed before i delete it.
is this only okay to do this? will this defeat its purpose? or is there any disadvantages?