|
|
|
|
|
by hogliux
2800 days ago
|
|
Because with a constexpr declaration everything will be constexpr, i.e. you couldn't modify the values at run-time. The idea here is that finding the storage of the value is done at compile-time, but the values themselves are run-time values. |
|
You could declare `static static_map<>::Value& get()` constexpr. (Actually you wouldn't need to; I think you could simply declare `semi::map<>::get()` to be constexpr) and I believe it would allow calling to look up a value to inlined at compile time.
However using it as an lvalue isn't possible with current c++ syntax. As a long time Lisp programmer this limitation continually trips me up.
Sorry about the backquotes; I know that HN doesn't use MD but it was the simplest way to denote code inline.