28 May
2016
28 May
'16
4:41 p.m.
On 28-05-16 16: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. Don't forget about alignment requirements.
I agree. Pimpl serves different goals. If the goal is just to hide implementation details (but not necessarily avoid recompilation on implementation change) this is very welcome. Though, soon, you'd verge to a "opaque value_ptr" where the value_ptr could have clone-semantics. So, I can see a choice for "pure Pimpl" facilities, without any optional stuff. Seth