mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
Added documentation for implicit struct pointer dereferencing
This commit is contained in:
parent
2f41bd3be4
commit
3e6952ad16
@ -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#}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user