Boost logo

Boost :

Subject: [boost] How do I specify no padding bytes within a struct/class?
From: Daryle Walker (darylew_at_[hidden])
Date: 2013-06-17 12:41:05


I've never done this before, so I'm asking first: how do I specify that a
struct/class should have no padding at all, at the start, end, or middle?
My classes have internal arrays, and specifying no padding lets users use an
array of classX<T> as an array of T (just like C++11 std::complex).
Complier-specific answers are OK, as long as I can use preprocessor flags to
isolate them.

I have a preprocessor flag that's currently set to 0 to indicate that
there's no packing. I'll change it to 1 whenever I get a compiler's packing
support.

Daryle W.


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