How to avoid ctRegex (solved)

cy via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Aug 27 10:35:04 PDT 2016


On Wednesday, 24 August 2016 at 05:29:57 UTC, ag0aep6g wrote:
> The plain regex function doesn't have such a requirement. It 
> also works with a pattern that's generated at run time, e.g. 
> from user input. But you can use it with a compile time 
> constant, too. And it works in CTFE then, but it does not 
> "generate optimized native machine code".

It's not using it with a compile time constant that struck me as 
weird. It's using it to assign a global variable that struck me 
as weird.

When I saw `auto a = b;` at the module level, I thought that b 
had to be something you could evaluate at compile time. But I 
guess it can be a runtime calculated value, acting like it was 
assigned in a a static this() clause, and the requirement for it 
to be compile time generated is only for immutable? like 
`immutable auto a = b`?


More information about the Digitalmars-d-learn mailing list