Currently shared_ptr and unique_ptr use implicit operator bool to be convertible to a bool value.
This causes some problems, such as:
shared_ptr<int> p(new int(10));
// ...
int x = p;
In this case p would be converted to a bool value and than converted to a int value, 0 or 1.
A better way is to define operator! and operator void*.
See: https://en.cppreference.com/w/cpp/language/implicit_conversion