commit d1f9b8184d61674a77424f026adfef2752d1dfdd (tree)
parent c19bdc2d370f3a72ef492e2f4e6264e2a0dd91ec
Author: Shawn Landden <shawn@git.icu>
Date: Mon, 6 May 2019 11:56:51 -0500
docs for @hasField
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/doc/langref.html.in b/doc/langref.html.in
@@ -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>