mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
langref: mention union support of @fieldParentPtr
This commit is contained in:
parent
b782cdb9b3
commit
92223ad36f
@ -4897,8 +4897,8 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
|
|||||||
{#header_open|@fieldParentPtr#}
|
{#header_open|@fieldParentPtr#}
|
||||||
<pre>{#syntax#}@fieldParentPtr(comptime field_name: []const u8, field_ptr: *T) anytype{#endsyntax#}</pre>
|
<pre>{#syntax#}@fieldParentPtr(comptime field_name: []const u8, field_ptr: *T) anytype{#endsyntax#}</pre>
|
||||||
<p>
|
<p>
|
||||||
Given a pointer to a struct field, returns a pointer to the struct containing that field.
|
Given a pointer to a struct or union field, returns a pointer to the struct or union containing that field.
|
||||||
The return type (and struct in question) is the inferred result type.
|
The return type (pointer to the parent struct or union in question) is the inferred result type.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
If {#syntax#}field_ptr{#endsyntax#} does not point to the {#syntax#}field_name{#endsyntax#} field of an instance of
|
If {#syntax#}field_ptr{#endsyntax#} does not point to the {#syntax#}field_name{#endsyntax#} field of an instance of
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user