I just need to know if I want to call my copyconstuctor from pImpl class, how will I do it?
For example:
CImpl::SomeFunc()
{
//cloning the caller class instance
caller = new Caller(*this)// I cant do this since its a pImpl class
}
How can i achieve this?
Well after reading your comments, it seems that you want to be able to provide the ability to make copies of
Callerclass. If so, then in that case you should implement the copy constructor forCallerclass, where you can make a hard copy ofm_pImplpointer.And then you can implement
Clone()function inCallerImplclass as:Now you can make copy of
Caller: