|
|
|
|
|
by dataflow
1700 days ago
|
|
You're seeing the compiler opportunistically make an optimization by taking constexpr as an extra inlining hint. I showed you it's not something you can rely on in my example. You have to realize constexpr only talks about what is allowed to happen, not what is guaranteed to happen. You want consteval for that. |
|
But consteval function is also not a literal replacement constexpr. For example, you can't take a pointer to the former. There's a reason they co-exist and are not useless.