aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorExonorid <exonorid@gmail.com>2022-01-16 10:18:23 -0700
committerVeikka Tuominen <git@vexu.eu>2022-01-27 19:33:07 +0200
commit3e6952ad16625197d569b99e2097ccc63172e201 (patch)
treee74323981127e0ea5d87290e482ed8e6af20b81e /doc
parent2f41bd3be438dae2a188cfae3295dc28f4e9d434 (diff)
downloadzig-3e6952ad16625197d569b99e2097ccc63172e201.tar.gz
zig-3e6952ad16625197d569b99e2097ccc63172e201.zip
Added documentation for implicit struct pointer dereferencing
Diffstat (limited to 'doc')
-rw-r--r--doc/langref.html.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in
index 825d03899e..40c2e431a3 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -3159,7 +3159,12 @@ test "linked list" {
.last = &node,
.len = 1,
};
+
+ // When using a pointer to a struct, fields can be accessed directly,
+ // without explicitly dereferencing the pointer.
+ // So you can do
try expect(list2.first.?.data == 1234);
+ // instead of try expect(list2.first.?.*.data == 1234);
}
{#code_end#}