Expressing range constraints in CNF form

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 11 13:21:37 PDT 2017


On Sunday, 11 June 2017 at 19:45:37 UTC, Walter Bright wrote:
> On 6/10/2017 5:28 PM, Andrei Alexandrescu wrote:
>>      && is(typeof(lvalueOf!R.popFront)) && msg("must support 
>> back");
>
> Wouldn't it work better as:
>
>     && (is(typeof(lvalueOf!R.popFront)) || msg("must support 
> back"));
>
>     bool msg(string) { return false; }
>
> ? Then msg() is only called if the first clause fails.

I can do a __ctfePrint for string literals.
(is(typeof(lvalueOf!R.popFront)) || __ctfePrint("bla"))

would work in a short amount of time.



More information about the Digitalmars-d mailing list