Boost logo

Boost :

Subject: Re: [boost] A Pimpl variant
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2010-04-02 10:43:23


> How? Does you RecklessPimpl class have an alignment parameter?
>

it would have a default alignment parameter. Defaulting to max
alignment based on the size parameter. Ie a 4 byte size would default
to 4 byte alignment. Size >= 8 means 8 byte alignment (typically). The
actual template to find a primitive type with the right alignment
based on size is pretty hairy. Not sure if I ever had a version that I
was happy with.

>
>
> Waiting for a proper Boost submission maybe you can share with us, which of
> the warnings H. Sutter  signal against RecklessPimpl do you solve with your
> implementation (alignment been the most important issue to me).
>

I think all of them. :-)

> Could you share also your implementation.
>

I would need to reimplement it from scratch as I don't have it
anymore. But I did it once so I'm sure I could do it again. It was
actually more general than pimpl. More of a manager of in place
construction and storage, with policies. Possibly overlapping with
some of the internals of boost.optional.

It also suffered from the forwarding problem when passing parameters
through to the underlying constructor. Not much you can do to fix
that, yet.

Tony


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