mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 20:50:41 +03:00
parent
b88ffc50d7
commit
3f90de47c1
4 changed files with 58 additions and 4 deletions
23
changelog/dmd.default-align.dd
Normal file
23
changelog/dmd.default-align.dd
Normal file
|
@ -0,0 +1,23 @@
|
|||
The `align` attribute now allows to specify `default` explicitly
|
||||
|
||||
A lone `align` sets the alignment to the type’s default.
|
||||
Alternatively, 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
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue