mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
Update dmd.reflocal.dd to include auto ref
(#16772)
This commit is contained in:
parent
c24631b2d4
commit
8dabb67ee5
1 changed files with 6 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
`ref` can now be applied to local, static, extern, and global variables
|
||||
`ref` and `auto ref` can now be applied to local, static, extern, and global variables
|
||||
|
||||
For example, one can now write:
|
||||
```
|
||||
|
@ -10,5 +10,10 @@ void main()
|
|||
ref int r = s.a;
|
||||
r = 3;
|
||||
assert(s.a == 3);
|
||||
|
||||
auto ref x = 0;
|
||||
auto ref y = x;
|
||||
static assert(!__traits(isRef, x));
|
||||
static assert( __traits(isRef, y));
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue