
15 Oct
2007
15 Oct
'07
4:54 p.m.
Has anyone looked into a 'FastPimpl'? (ie see http://www.gotw.ca/publications/mill05.htm, including the list of reasons not to). I wrote a generic FastPimpl once that looked something like this: //h file // forward declare: class MyImplementation; class Wrapper { //... private: FastPimpl<MyImplementation, 24> m_Impl; // m_Impl works like a pointer, but isn't. It is embedded. }; The '24' above is a guess at the required size of MyImplementation. If the size is wrong, the cpp doesn't compile. My version overloaded copy, assign, etc, to 'do the right thing' ie pass it on the underlying MyImplementation. Just a thought. Tony