Thread overview | ||||||
---|---|---|---|---|---|---|
|
October 03, 2019 using regex at compile time errors out! Error: static variable `thompsonFactory` cannot be read at compile time | ||||
---|---|---|---|---|
| ||||
auto r = replaceAll!((C) { return "X"; } )(s, regex(`Y`)); Error: static variable `thompsonFactory` cannot be read at compile time This is when the result is tried to be determined at compile time, e.g., assigning it to an enum even though s is known at compile time. |
October 04, 2019 Re: using regex at compile time errors out! Error: static variable `thompsonFactory` cannot be read at compile time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brett | Have you tried ctRegex? |
October 05, 2019 Re: using regex at compile time errors out! Error: static variable `thompsonFactory` cannot be read at compile time | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinke | On Friday, 4 October 2019 at 10:07:40 UTC, kinke wrote:
> Have you tried ctRegex?
Yes, just another error about something else that I don't remember.
|
October 05, 2019 Re: using regex at compile time errors out! Error: static variable `thompsonFactory` cannot be read at compile time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brett | On Thursday, 3 October 2019 at 23:47:17 UTC, Brett wrote:
> Error: static variable `thompsonFactory` cannot be read at compile time
std.regex isn't ctfe compatible, alas.
even the ctRegex doesn't work at ctfe; it *compiles* the regex at compile time, but it is not capable of actually *running* it at compile time.
(the regular regex is compiled and run at runtime)
|
Copyright © 1999-2021 by the D Language Foundation