When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.
A *a=func();shared_ptr<B> p(a ? a->makeB() : nullptr);if (p) ...
shared_ptr<B> p(nullptr);A *a=func();if (a) p=shared_ptr<B>(a->makeB());if (p)
CodeA *a=func();shared_ptr<B> p(a ? a->makeB() : nullptr);if (p) ...