What should we do so the Container class below is well implemented ?
Container
class Component {}; class Container { Component& c; public: Container(): c(*(new Component())) {} }
Nothing, there is no issue with this code
Use a pointer for the c attribute instead of a reference
c
Implement the following destructor ~Container() { delete &c; }
~Container() { delete &c; }
Implement the following destructor ~Container() { delete *c; }
~Container() { delete *c; }