Why does this code NOT generate a double free when the shared pointers go out of scope?
int main()
{
{
auto * ptr = new int(1);
shared_ptr<int> a( ptr );
shared_ptr<int> b( ptr );
cout << "ok: " << *a << *b << endl;
}
cout << "still ok" << endl;
return 0;
}