On Sunday, 27 November 2016 at 13:58:29 UTC, Guillaume Piolat
wrote:
On Sunday, 27 November 2016 at 13:35:48 UTC, Andrei
Alexandrescu wrote:
A useful intermediate step is to have these "[shared] static
this" ctor
call a function instead, so that programs without druntime
can call them
too.
That would be progress.
Andrei
Same story for core.cpuid which is initialized by a shared
static constructor.
https://github.com/dlang/druntime/blob/master/src/core/cpuid.d
It seems the "shared static this" is allowed to break immutable
but a function wouldn't. So maybe the variables here should be
private __gshared?.
They are in Mir CPUID, but methods are not pure.
https://github.com/libmir/mir-cpuid/blob/master/source/cpuid/x86_any.d