aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRaul Leal <raulgrell@gmail.com>2017-04-20 11:36:59 +0000
committerRaul Leal <raulgrell@gmail.com>2017-04-20 11:53:00 +0000
commit5234016561ab4a771e908fdff78b2871850626c6 (patch)
treea04b9bb3fca7fcc650bf7928e7ea5413225d20e7 /doc
parent037a9d937d41552a44f8fd597e14a2d3491cb499 (diff)
downloadzig-5234016561ab4a771e908fdff78b2871850626c6.tar.gz
zig-5234016561ab4a771e908fdff78b2871850626c6.zip
Add @offsetOf builtin function
Diffstat (limited to 'doc')
-rw-r--r--doc/langref.md4
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,