26 Oct
2016
26 Oct
'16
3:41 p.m.
On 10/26/2016 10:17 AM, degski wrote:
On 26 October 2016 at 18:00, Michael Marcin
wrote: But I don't know how to query the alignment of an object rather than a type.
Shouldn't ( & object [ 0 ] ) % 16 == 0 do the trick?
Or use: boost::alignment::detail::is_aligned(&object[0], 16). However, that code uses: boost::alignment::is_aligned ( std::size_t value , std::size_t alignment ) { return (value & (alignment - 1)) == 0; } which is more obscure than: return (value % alignment) == 0; But I guess there's some reason for using the more obscure code.