zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 3e6952ad16625197d569b99e2097ccc63172e201 (tree)
parent 2f41bd3be438dae2a188cfae3295dc28f4e9d434
Author: Exonorid <exonorid@gmail.com>
Date:   Sun, 16 Jan 2022 10:18:23 -0700

Added documentation for implicit struct pointer dereferencing

Diffstat:
Mdoc/langref.html.in | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git 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#}