Blah* b = new Blah();
std::shared_ptr<Blah> good(b->shared_from_this());
This is not true. To work shared_from_this, it bmust already belong to at least one shared_ptr. You should use:
std::shared_ptr<Blah> b = new B();
Blah* raw = b.get();
std::shared_ptr<Blah> good(raw->shared_from_this());
Of course, in this trivial example, this is simpler:
std::shared_ptr<Blah> good(b);
There is nothing inside:
std::shared_ptr<Blah> bad(new Blah());
new B() b, b .