Re: assert format of a string before a mixin

2020-09-27 Thread ddcovery via Digitalmars-d-learn
On Sunday, 27 September 2020 at 21:41:25 UTC, Adam D. Ruppe wrote: On Sunday, 27 September 2020 at 21:38:43 UTC, ddcovery wrote: i.e. checking this Regex expression `^[a-zA-Z_]*[a-zA-Z0-9_]*[a-zA-Z][a-zA-Z0-9_]*$` Is there any way to check a regular expression at compile time? Not really an

Re: assert format of a string before a mixin

2020-09-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 September 2020 at 21:38:43 UTC, ddcovery wrote: i.e. checking this Regex expression `^[a-zA-Z_]*[a-zA-Z0-9_]*[a-zA-Z][a-zA-Z0-9_]*$` Is there any way to check a regular expression at compile time? Not really and I'd actually suggest not trying because even if it did work, it'd

assert format of a string before a mixin

2020-09-27 Thread ddcovery via Digitalmars-d-learn
I have a "variation" of "unaryFun" that I name "unaryProp" that, basically, doesn't require to specify "a." at the beginning of the expression. template unaryProp(alias propName) { static assert(is(typeof(propName) : string), "Sorry, propName must be an string"); auto unaryProp(ElementTy