mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
parent
1dbee05609
commit
d484269543
1 changed files with 4 additions and 1 deletions
|
|
@ -4710,8 +4710,11 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
|
|||
Converts an integer into an {#link|enum#} value. The return type is the inferred result type.
|
||||
</p>
|
||||
<p>
|
||||
Attempting to convert an integer which represents no value in the chosen enum type invokes
|
||||
Attempting to convert an integer with no corresponding value in the enum invokes
|
||||
safety-checked {#link|Undefined Behavior#}.
|
||||
Note that a {#link|non-exhaustive enum|Non-exhaustive enum#} has corresponding values for all
|
||||
integers in the enum's integer tag type: the {#syntax#}_{#endsyntax#} value represents all
|
||||
the remaining unnamed integers in the enum's tag type.
|
||||
</p>
|
||||
{#see_also|@intFromEnum#}
|
||||
{#header_close#}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue