Skip to content

Commit 310812a

Browse files
authored
Create const_eval.md
1 parent 4e7bb21 commit 310812a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/const_eval.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Constant evaluation
2+
3+
Constant evaluation is the process of computing the result of
4+
[expressions] during compilation.
5+
6+
## Const context
7+
8+
A _const context_ is one of the following:
9+
10+
* [array type length expressions]
11+
* repeat expression length expessions
12+
* the initializer of
13+
* [constants]
14+
* [statics]
15+
* [enum discriminants]
16+
17+
[array type length expressions]: types.html#array-and-slice-types
18+
[enum discriminants]: items/enumerations.html#custom-discriminant-values-for-field-less-enumerations
19+
[constants]: items/constant-items.html
20+
[statics]: items/static-items.html
21+
[expressions]: expressions.html#constant-expressions

0 commit comments

Comments
 (0)