Title
[tiny] constexpr functions must work at runtime
Status
nad
Section
[expr.const]
Submitter
Dave Abrahams

Created on 2012-10-16.00:00:00 last changed 140 months ago

Messages

Date: 2013-04-28.20:20:29

constexpr functions are crippled by the fact that they have to be valid at runtime. Things that are tantalizingly close but you can't quite do include returning a type that depends on the /value/ of a function parameter:

  constexpr auto ptr_array(int N) -> int(*)[N]
  { ... }
If we would allow for constexpr functions that can only be evaluated at compile time, we'd be able to do compile-time computation in a much less template-heavy way.

Bristol 2013: Gregor thought that wrt general direction, constexpr is specifically not to have a constexpr-only model, and this issue would go into the opposite direction. NAD.

History
Date User Action Args
2013-04-28 20:20:29adminsetstatus: open -> nad
2012-10-16 00:00:00admincreate