id summary reporter owner description type status milestone component version severity resolution keywords cc 993 Variant should use least common multiple of alignments, rather than maximum ebf ebf "'''Problem''': Reported by Larry Evans on 19 May 2007: {{{ The make_storage template at line 215 of: http://boost.cvs.sourceforge.net/boost/boost/boost/variant/variant.hpp?revision=1.97&view=markup uses max over the alignment_of's for the types in the variant (See line2 233-235) to calculate the variant's alignment. However, to handle the extended alignments described on page 3 of: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2165.pdf the boost::math::static_lcm template should be used instead of max. }}} As described in the [http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2165.pdf cited document], ""alignments have an order from weaker to ... stricter alignments,"" and ""stricter alignments have larger alignment values."" But the problem is that ""a larger alignment is not necessarily proper alignment for a weaker alignment."" Thus taking the maximum alignment does not guarantee that the alignment is proper for types with weaker alignments. '''Proposed resolution''': Use the `static_lcm` template as proposed by Larry. Choosing the least common multiple of all the alignments results in a proper alignment for all of the types because ""an alignment requirement is satisfied by [any alignment] that [is] a multiple of it.""" Bugs closed Boost 1.36.0 variant Problem fixed