docs for @hasField

This commit is contained in:
Shawn Landden 2019-05-06 11:56:51 -05:00
parent c19bdc2d37
commit d1f9b8184d

View File

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