authorgravatar for rohlemF@gmail.comrohlem <rohlemF@gmail.com> 2025-09-17 23:11:46+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-17 20:07:30-07:00
log92223ad36f4e2103b470b7e32bb2c61bc9e52904
tree61adbe257391d79d38af739b8411d29a6789c7e2
parentb782cdb9b37ba61476cf28632a2f1e10d631dcab

langref: mention union support of `@fieldParentPtr`


1 files changed, 2 insertions(+), 2 deletions(-)

doc/langref.html.in+2-2
...@@ -4897,8 +4897,8 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val...@@ -4897,8 +4897,8 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
4897 {#header_open|@fieldParentPtr#}4897 {#header_open|@fieldParentPtr#}
4898 <pre>{#syntax#}@fieldParentPtr(comptime field_name: []const u8, field_ptr: *T) anytype{#endsyntax#}</pre>4898 <pre>{#syntax#}@fieldParentPtr(comptime field_name: []const u8, field_ptr: *T) anytype{#endsyntax#}</pre>
4899 <p>4899 <p>
4900 Given a pointer to a struct field, returns a pointer to the struct containing that field.4900 Given a pointer to a struct or union field, returns a pointer to the struct or union containing that field.
4901 The return type (and struct in question) is the inferred result type.4901 The return type (pointer to the parent struct or union in question) is the inferred result type.
4902 </p>4902 </p>
4903 <p>4903 <p>
4904 If {#syntax#}field_ptr{#endsyntax#} does not point to the {#syntax#}field_name{#endsyntax#} field of an instance of4904 If {#syntax#}field_ptr{#endsyntax#} does not point to the {#syntax#}field_name{#endsyntax#} field of an instance of