Boost logo

Boost :

Subject: Re: [boost] interest in structure of arrays container?
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2016-10-27 02:34:17


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?


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