mirror of
https://github.com/ziglang/zig.git
synced 2026-01-12 02:15:12 +00:00
docs for @hasField
This commit is contained in:
parent
c19bdc2d37
commit
d1f9b8184d
@ -6867,6 +6867,16 @@ fn add(a: i32, b: i32) i32 { return a + b; }
|
||||
It does not include functions, variables, or constants.
|
||||
</p>
|
||||
{#header_close#}
|
||||
{#header_open|@hasField#}
|
||||
<pre>{#syntax#}@hasField(comptime T: type, comptime name: []u8) bool{#endsyntax#}</pre>
|
||||
<p>Returns if the field name of a struct, union, or enum exists.</p>
|
||||
<p>
|
||||
The result is a compile time constant.
|
||||
</p>
|
||||
<p>
|
||||
It does not include functions, variables, constants.
|
||||
</p>
|
||||
{#header_close#}
|
||||
{#header_open|@memberType#}
|
||||
<pre>{#syntax#}@memberType(comptime T: type, comptime index: usize) type{#endsyntax#}</pre>
|
||||
<p>Returns the field type of a struct or union.</p>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user