Added documentation for implicit struct pointer dereferencing

This commit is contained in:
Exonorid
2022-01-16 10:18:23 -07:00
committed by Andrew Kelley
parent 922d33e5b9
commit ac3d9759ed

View File

@@ -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#}