lundi 29 février 2016

How can create an instance of class into an other class whithout invoking destructor method in c++

I try to instantiate my class A (its goal is to notify other classes observers by a result ) into class B and after adding the observers the class A call its destructor and delete these observers . What I want is to instantiate my class A into class B without invoking the destructor. I think about a handler class which will be singleton but nothing is clear in my mind. Please help me. I code with c++.

Aucun commentaire:

Enregistrer un commentaire