|
|
|
|
|
by gumby
2796 days ago
|
|
Thanks, I wasn't very clear but now I see the problem. The C++ invocation syntax (basically the difference between expressions and statements inherited from Algol) makes it impossible to call if you want to update it at runtime. 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. |
|