I am currently learning shared_ptr's alias constructor, and I wrote code like this
int main(){
    std::shared_ptr<Father> father = std::make_shared<Father>();
    std::shared_ptr<Son> son(father, &father->son);
    printf("%d\n", father.use_count());
    printf("%d\n", son.use_count());
    father.reset();
    printf("%d\n", father.use_count());
    printf("%d\n", son.use_count());
    printf("%d\n", father.owner_before(son));
    printf("%d\n", son.owner_before(father));
    return 0;
}
And it prints out
2
2
0
1
1
0
And I got lost here. In my opinion, after father.reset(), father should still have use_count = 1 rather than 0, because son is alias constructed from father, and it not destructed. From this post, the author also says father.use_count() is 1.
// the Foo still exists (ref cnt == 1) // so our Bar pointer is still valid, and we can use it for stuff
So why printf("%d\n", father.use_count()); prints out to be 0?