Traditionally, in C++, you would create any dependencies in the constructor and delete them in the destructor.
class A
{
public:
A() { m_b = new B(); }
This technique is best known as RAII - Resource Allocation Is Initialization. It has its own tag on this site.
Alternative. more intuitive names have been suggested, in particular: