diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-04-07 15:34:13 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-04-07 15:35:38 -0400 |
| commit | f7e9d7aa5d115a6a8158625cd1aceb7e8dafe880 (patch) | |
| tree | a6a7ef8030a4b44d4b87b8e04fe7002c006ce381 /doc | |
| parent | ffb4852012509327c646c9899259e894965b2259 (diff) | |
| download | zig-f7e9d7aa5d115a6a8158625cd1aceb7e8dafe880.tar.gz zig-f7e9d7aa5d115a6a8158625cd1aceb7e8dafe880.zip | |
ability to implicitly cast integer literal to &const Int
where Int is an integer type
also introduce `@intToPtr` builtin for converting a usize
to a pointer. users now have to use this instead of `(&T)(int)`.
closes #311
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/langref.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/langref.md b/doc/langref.md index 9a06672c6d..1849ef0351 100644 --- a/doc/langref.md +++ b/doc/langref.md @@ -621,3 +621,7 @@ if there is not one specified, invokes the one provided in ### @ptrcast(comptime DestType: type, value: var) -> DestType Converts a pointer of one type to a pointer of another type. + +### @intToPtr(comptime DestType: type, int: usize) -> DestType + +Converts an integer to a pointer. To convert the other way, use `usize(ptr)`. |
