Commit d1f9b8184d

Shawn Landden <shawn@git.icu>
2019-05-06 18:56:51
docs for @hasField
1 parent c19bdc2
Changed files (1)
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>