C++17 cannot beat D surely
ag0aep6g via Digitalmars-d
digitalmars-d at puremagic.com
Sat Jun 3 14:04:16 PDT 2017
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.
More information about the Digitalmars-d
mailing list