Boost logo

Boost :

From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2007-10-15 12:54:53


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk