Subject: Re: [boost] Pimpl Again?
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2016-05-29 20:12:45
On 29/05/2016 02:25, Chris Glover wrote:
> One addition I would like to see is a version where the heap allocation is
> avoided by storing an internal buffer in the base class. Yes, this means
> one needs to keep the size in sync between the impl and the header, but
> this can be an important optimization sometimes.
Ideally the header should store a max size / capacity -- construction
succeeds as long as the "real" impl is equal to or smaller than this.
This allows a bit of flexibility for different layouts used by different
compilers, or for "expansion room" without breaking consumers.
Though you don't want to leave too much wiggle room. Memory is cheap
but cache is less so.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk