// I prefer to perform forward declaration on myclass, as I do not // wish to ship "myclass.h" to client // However, the following code doesn't allow me to do so, as class defination // is needed in header file. // // ah #include "myclass.h" class a { public: a(); myclass me; };
I try to do it differently. However, I need to use dynamic allocation, which I usually try to avoid.
Can this be done without using any reference or pointer? (Or, more precisely, without using a new / delete)
source share