primitive vector types

Jarrett Billingsley jarrett.billingsley at gmail.com
Thu Feb 19 19:00:52 PST 2009


On Thu, Feb 19, 2009 at 9:31 PM, Daniel Keep
<daniel.keep.lists at gmail.com> wrote:
>> struct float4
>> {
>>     __align(16) float[4] data; // right syntax and value?
>>     alias data this;
>> }

> 1. The alignment thing.  Incidentally, I just did a quick check and
> don't see any notes in the changelog about __align(n) syntax.  As I
> remember, there was no way to actually ensure the data was properly
> aligned.  (There's "Data items in static data segment >= 16 bytes in
> size are now paragraph aligned." but that doesn't help when the vectors
> are on, say, the stack or in the heap.)

It's just align(16).

http://www.digitalmars.com/d/1.0/attribute.html#align



More information about the Digitalmars-d mailing list