Boost logo

Boost :

Subject: Re: [boost] [pimpl] Some comments
From: Bjorn Reese (breese_at_[hidden])
Date: 2014-06-06 05:17:04


On 06/05/2014 11:21 PM, Andrzej Krzemienski wrote:

> [1] The main point in using pimpl idiom (at least my) is to avoid header
> inclusion, which may grow compilation time too much (at the expense of

My main use case for pimpl is also to avoid header inclusion, but for a
different reason. When wrapping third-party software, you usually want
to avoid exposing their symbols in your own headers. For instance, you
may have a C header full of macros that could clash with symbols
elsewhere. By limiting the inclusion of those third-party headers to
the .cpp file with the pimpl, you do not pollute the global "namespace".


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