On Saturday, 3 June 2017 at 21:04:16 UTC, ag0aep6g wrote:
On 06/03/2017 10:29 PM, Stanislav Blinov wrote:
Meep. Wrong :)
Static initializers for static variables and constants are
evaluated at compile time, initializing them with runtime
values is a compile-time error.
Meep. Meep. I wouldn't say you're wrong, but there's nitpicking
to be done.
You can't use a run-time value as the initializer, but you
*can* initialize a static variable with a run-time value: using
a static constructor.
Mental note to self: never write assuming sentences in a NG :)
You're correct, of course. I meant inline initialization, as
presented in the code in question.