#include <memory> using namespace std; #include "X2.h" #include "Y.h" X2::X2 () : py_ (new Y) { } // destructor needs to be explicitly implemented otherwise // the compiler can not generate a destructor which takes care of // py_ correctly (memory leak) X2::~X2 () { }