decls

    Dark Mode
Search:
Group by:

Templates

template byaddr(lhs, typ, ex)
Allows a syntax for lvalue reference, exact analog to auto& a = ex; in C++

Examples:

var s = @[10, 11, 12]
var a {...}{.byaddr.} = s[0]
a += 100
doAssert s == @[110, 11, 12]
doAssert a is int
var b {...}{.byaddr.}: int = s[0]
doAssert a.addr == b.addr
  Source Edit