Commit 02b61224b2
Changed files (1)
doc/langref.html.in
@@ -4217,17 +4217,28 @@ fn add(a: i32, b: i32) i32 { return a + b; }
{#header_open|@memberCount#}
<pre><code class="zig">@memberCount(comptime T: type) -> (number literal)</code></pre>
<p>
- This function returns the number of enum values in an enum type.
+ This function returns the number of members in a struct, enum, or union type.
</p>
<p>
The result is a compile time constant.
</p>
+ <p>
+ It does not include functions, variables, or constants.
+ </p>
{#header_close#}
{#header_open|@memberName#}
- <p>TODO</p>
+ <pre><code class="zig">@memberName(comptime T: type, comptime index: usize) -> [N]u8</code></pre>
+ <p>Returns the field name of a struct, union, or enum.</p>
+ <p>
+ The result is a compile time constant.
+ </p>
+ <p>
+ It does not include functions, variables, or constants.
+ </p>
{#header_close#}
{#header_open|@memberType#}
- <p>TODO</p>
+ <pre><code class="zig">@memberType(comptime T: type, comptime index: usize) -> type</code></pre>
+ <p>Returns the field type of a struct or union.</p>
{#header_close#}
{#header_open|@memcpy#}
<pre><code class="zig">@memcpy(noalias dest: &u8, noalias source: &const u8, byte_count: usize)</code></pre>
@@ -5856,7 +5867,7 @@ hljs.registerLanguage("zig", function(t) {
a = t.IR + "\\s*\\(",
c = {
keyword: "const align var extern stdcallcc nakedcc volatile export pub noalias inline struct packed enum union break return try catch test continue unreachable comptime and or asm defer errdefer if else switch while for fn use bool f32 f64 void type noreturn error i8 u8 i16 u16 i32 u32 i64 u64 isize usize i8w u8w i16w i32w u32w i64w u64w isizew usizew c_short c_ushort c_int c_uint c_long c_ulong c_longlong c_ulonglong",
- built_in: "breakpoint returnAddress frameAddress fieldParentPtr setFloatMode IntType OpaqueType compileError compileLog setCold setRuntimeSafety setEvalBranchQuota offsetOf memcpy inlineCall setGlobalLinkage setGlobalSection divTrunc divFloor enumTagName intToPtr ptrToInt panic canImplicitCast ptrCast bitCast rem mod memset sizeOf alignOf alignCast maxValue minValue memberCount typeOf addWithOverflow subWithOverflow mulWithOverflow shlWithOverflow shlExact shrExact cInclude cDefine cUndef ctz clz import cImport errorName embedFile cmpxchg fence divExact truncate",
+ built_in: "breakpoint returnAddress frameAddress fieldParentPtr setFloatMode IntType OpaqueType compileError compileLog setCold setRuntimeSafety setEvalBranchQuota offsetOf memcpy inlineCall setGlobalLinkage setGlobalSection divTrunc divFloor enumTagName intToPtr ptrToInt panic canImplicitCast ptrCast bitCast rem mod memset sizeOf alignOf alignCast maxValue minValue memberCount memberName memberType typeOf addWithOverflow subWithOverflow mulWithOverflow shlWithOverflow shlExact shrExact cInclude cDefine cUndef ctz clz import cImport errorName embedFile cmpxchg fence divExact truncate",
literal: "true false null undefined"
},
n = [e, t.CLCM, t.CBCM, s, r];