authorgravatar for exonorid@gmail.comExonorid <exonorid@gmail.com> 2022-01-16 10:18:23-07:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-01-27 19:33:07+02:00
log3e6952ad16625197d569b99e2097ccc63172e201
treee74323981127e0ea5d87290e482ed8e6af20b81e
parent2f41bd3be438dae2a188cfae3295dc28f4e9d434

Added documentation for implicit struct pointer dereferencing


1 files changed, 5 insertions(+), 0 deletions(-)

doc/langref.html.in+5
...@@ -3159,7 +3159,12 @@ test "linked list" {...@@ -3159,7 +3159,12 @@ test "linked list" {
3159 .last = &node,3159 .last = &node,
3160 .len = 1,3160 .len = 1,
3161 };3161 };
3162
3163 // When using a pointer to a struct, fields can be accessed directly,
3164 // without explicitly dereferencing the pointer.
3165 // So you can do
3162 try expect(list2.first.?.data == 1234);3166 try expect(list2.first.?.data == 1234);
3167 // instead of try expect(list2.first.?.*.data == 1234);
3163}3168}
3164 {#code_end#}3169 {#code_end#}
31653170