Hacker News new | ask | show | jobs
by PowerGuido87 2674 days ago
So they're more like C++20's consteval?

http://wg21.link/p1073r3

1 comments

As I understand it, not really no.

The conceptual difference between constexpr and consteval is that consteval is guaranteed to be evaluated at compile-time, so unlike constexpr code, consteval code will never actually end up as a function in your binary.

Rust's const fns on the other hand can be called at runtime, so in that respect they'd be closer to constexpr.