Boost logo

Boost :

Subject: Re: [boost] [Booster] Or boost is useless for library developers
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-05-21 04:41:30


Hi all,

Sometimes I have used a variant of PImpl idiom that hides all the private functions and private static data of a class (not a template) on a XImpl class.

Even if this doesn't hides the data, it reduces considerably the compilation time and the dependencies on the header files. One of the advantages of the approach is that it not incurs in allocation/deallocation of the XImpl class as this class has no other data than static one. The other is that your header file doesn't change when you refactor your implementation adding, removing or modifying private functions or private static data (as far as you don't need to change the member data, of course). Note that this schema don't forbids the compiler for inlining on the implementation file.

You can see an usage example here http://viboes.blogspot.com/2010/04/pimpl-variant.html.

Of course this is not applicable to templates, which are the big part of most of the Boost libraries, and it doesn't solves the ABI problem neither.

Any comments are welcome :)

Best,
_____________________
Vicente Juan Botet Escribá
http://viboes.blogspot.com/


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