4 ms·
I think that's it in a nutshell. You can't evaluate everything at compile time, even when you could theoretically. So you need some way to mark the subset of pu
by eloff 6y ago
I think that's it in a nutshell. You can't evaluate everything at compile time, even when you could theoretically. So you need some way to mark the subset of pure functions that can be evaluated at compile time, which is what const fn does. That way if a const fn only calls other const functions you know you can evaluate it. It's a convenient way of tagging functions.
- tgb 6y agoThat makes sense, thanks.
- thomasahle 6y agoThat's what I thought I said in the original comment. I wonder what people disliked.