Can I run this at compile time?

Mengu mengukagan at gmail.com
Wed Dec 20 17:16:50 UTC 2017


On Wednesday, 20 December 2017 at 16:54:35 UTC, Marc wrote:
> Give this function I'd like to run it at compile time:
>
> 	import std.concurrency : Generator, yield;
>>[...]
>
> but when I do:
>
>> [...]
>
> I get the following erros:
>
> C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\thread.d(4059): Error: static variable PAGESIZE cannot be read at compile time
> C:\D\dmd2\windows\bin\..\..\src\phobos\std\concurrency.d(1548):
>      called from here: super.this(dg, PAGESIZE * 4u, PAGESIZE)
> app.d(96):        called from here: getNonIntegralMembers()

if PAGESIZE is not dynamic, it will not work at compile time. 
make it an enum or const and give it a try.


More information about the Digitalmars-d-learn mailing list