authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-01-31 20:56:53-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-01-31 20:56:53-05:00
log02b61224b234b017cd2397ee6e8936c220b959f5
tree4b0c7cffae01ab34bb7bd68e80c6445eacd442c7
parente6d4028a84d0e9b9835c38f57b5b0d4bbc101394

add docs for memberType, memberCount, memberName


1 files changed, 15 insertions(+), 4 deletions(-)

doc/langref.html.in+15-4
...@@ -4217,17 +4217,28 @@ fn add(a: i32, b: i32) i32 { return a + b; }...@@ -4217,17 +4217,28 @@ fn add(a: i32, b: i32) i32 { return a + b; }
4217 {#header_open|@memberCount#}4217 {#header_open|@memberCount#}
4218 <pre><code class="zig">@memberCount(comptime T: type) -&gt; (number literal)</code></pre>4218 <pre><code class="zig">@memberCount(comptime T: type) -&gt; (number literal)</code></pre>
4219 <p>4219 <p>
4220 This function returns the number of enum values in an enum type.4220 This function returns the number of members in a struct, enum, or union type.
4221 </p>4221 </p>
4222 <p>4222 <p>
4223 The result is a compile time constant.4223 The result is a compile time constant.
4224 </p>4224 </p>
4225 <p>
4226 It does not include functions, variables, or constants.
4227 </p>
4225 {#header_close#}4228 {#header_close#}
4226 {#header_open|@memberName#}4229 {#header_open|@memberName#}
4227 <p>TODO</p>4230 <pre><code class="zig">@memberName(comptime T: type, comptime index: usize) -&gt; [N]u8</code></pre>
4231 <p>Returns the field name of a struct, union, or enum.</p>
4232 <p>
4233 The result is a compile time constant.
4234 </p>
4235 <p>
4236 It does not include functions, variables, or constants.
4237 </p>
4228 {#header_close#}4238 {#header_close#}
4229 {#header_open|@memberType#}4239 {#header_open|@memberType#}
4230 <p>TODO</p>4240 <pre><code class="zig">@memberType(comptime T: type, comptime index: usize) -&gt; type</code></pre>
4241 <p>Returns the field type of a struct or union.</p>
4231 {#header_close#}4242 {#header_close#}
4232 {#header_open|@memcpy#}4243 {#header_open|@memcpy#}
4233 <pre><code class="zig">@memcpy(noalias dest: &u8, noalias source: &const u8, byte_count: usize)</code></pre>4244 <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) {...@@ -5856,7 +5867,7 @@ hljs.registerLanguage("zig", function(t) {
5856 a = t.IR + "\\s*\\(",5867 a = t.IR + "\\s*\\(",
5857 c = {5868 c = {
5858 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",5869 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",
5859 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",5870 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",
5860 literal: "true false null undefined"5871 literal: "true false null undefined"
5861 },5872 },
5862 n = [e, t.CLCM, t.CBCM, s, r];5873 n = [e, t.CLCM, t.CBCM, s, r];