Pimpl idiom without using dynamic memory allocation
Warning: the code here only showcases the storage aspect, it is a skeleton, no dynamic aspect (construction, copy, move, destruction) has been taken into account. I would suggest an approach using the C++0x new class aligned_storage, which is precisely meant for having raw storage. // header class Foo { public: private: struct Impl; Impl& impl() … Read more