diff options
| author | Raul Leal <raulgrell@gmail.com> | 2017-04-20 11:36:59 +0000 |
|---|---|---|
| committer | Raul Leal <raulgrell@gmail.com> | 2017-04-20 11:53:00 +0000 |
| commit | 5234016561ab4a771e908fdff78b2871850626c6 (patch) | |
| tree | a04b9bb3fca7fcc650bf7928e7ea5413225d20e7 /doc | |
| parent | 037a9d937d41552a44f8fd597e14a2d3491cb499 (diff) | |
| download | zig-5234016561ab4a771e908fdff78b2871850626c6.tar.gz zig-5234016561ab4a771e908fdff78b2871850626c6.zip | |
Add @offsetOf builtin function
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 6d6b9b63ce..e1d2dbccb5 100644 --- a/doc/langref.md +++ b/doc/langref.md @@ -314,6 +314,10 @@ for the current target. The result is a target-specific compile time constant. +### @offsetOf(comptime T: type, comptime field_name: [] const u8) -> (number literal) + +This function returns the byte offset of a field relative to its containing struct. + ### Overflow Arithmetic These functions take an integer type, two variables of the specified type, |
