27 Oct
2016
27 Oct
'16
6:34 a.m.
On 10/27/2016 12:51 AM, degski wrote:
Yes, resorting to some bit-fiddling then:
size_t whatIsTheAlignmentOfThisPointer ( const void* p_ ) {
return ( size_t ) ( ( uintptr_t ) p_ & ( uintptr_t ) -( ( intptr_t ) p_ ) ); }
Again where the object happens to live is *not* necessarily its required alignment. Take: char a; alignas(16) char b; char a (1 byte alignment) may reside on a a 16 byte boundary. But that doesn't mean that the char is being forced to a 16 byte alignment. char b *is* required to be aligned to a 16 byte boundary. Anyways this is all a distraction from the issues at hand. Can we get back to on topic discussions?