3 ms·
Can increase in use of `const fn`'s create a noticeable decrease in compile times? As someone whose never worked on compilers, I'm not really sure what the magn
by scudd 6y ago
Can increase in use of `const fn`'s create a noticeable decrease in compile times? As someone whose never worked on compilers, I'm not really sure what the magnitude of that processing time is in relation to everything else.
- jsheard 6y agoThe compiler would already evaluate most of this stuff at compile time, you just weren't allowed to rely on it until now. e.g. char::is_ascii_alphabetic() was made const in 1.47, but 1.46 would already run it at compile time: https://godbolt.org/z/hWf65f https://godbolt.org/z/hWf65f The difference is in 1.47 you can use the result to assign something that must be known at compile time.