
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