authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-04 18:05:14-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-04 18:05:14-05:00
log116e2a93f1ab068ee46f4b7cce6b3306334cdec6
tree412c9f53fcefcb5117b89323cbf526289a4a90a0
parent3e3d46488419445c1b3a4b1da384f084c71cddb0
signature Commit is signed but in an unrecognized format.

update docs for `@TypeOf`


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

doc/langref.html.in+6-4
......@@ -8371,12 +8371,14 @@ test "integer truncation" {
83718371 {#header_close#}
83728372
83738373 {#header_open|@TypeOf#}
8374 <pre>{#syntax#}@TypeOf(expression) type{#endsyntax#}</pre>
8374 <pre>{#syntax#}@TypeOf(...) type{#endsyntax#}</pre>
83758375 <p>
8376 This function returns a compile-time constant, which is the type of the
8377 expression passed as an argument. The expression is evaluated.
8376 {#syntax#}@TypeOf{#endsyntax#} is a special builtin function that takes any (nonzero) number of expressions
8377 as parameters and returns the type of the result, using {#link|Peer Type Resolution#}.
8378 </p>
8379 <p>
8380 The expressions are evaluated, however they are guaranteed to have no <em>runtime</em> side-effects:
83788381 </p>
8379 <p>{#syntax#}@TypeOf{#endsyntax#} guarantees no run-time side-effects within the expression:</p>
83808382 {#code_begin|test#}
83818383const std = @import("std");
83828384const assert = std.debug.assert;