mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 20:50:41 +03:00
23 lines
410 B
Text
23 lines
410 B
Text
The `align` attribute now allows specifying `default` explicitly
|
||
|
||
A lone `align` sets the alignment to the type’s default.
|
||
To be more explicit, `align(default)` does the same.
|
||
|
||
```
|
||
struct S
|
||
{
|
||
align(4)
|
||
{
|
||
byte x;
|
||
align(default) long y;
|
||
long z;
|
||
}
|
||
}
|
||
|
||
void main()
|
||
{
|
||
pragma(msg, S.x.alignof); // 4
|
||
pragma(msg, S.y.alignof); // 8
|
||
pragma(msg, S.z.alignof); // 4
|
||
}
|
||
```
|