Expressing range constraints in CNF form

crimaniak via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 11 12:07:40 PDT 2017


On Sunday, 11 June 2017 at 00:28:58 UTC, Andrei Alexandrescu 
wrote:
> enum bool isInputRange(R) =
>     is(typeof((ref R r) => r)) && "must be copyable"

Regardless of the implementation method, this will require the 
previously proposed Phobos refactoring. Independent special 
definitions have to be reduced to general ones and use "static 
if" to select the algorithm. Otherwise, each failed independent 
definition will give an additional error message, and the 
compiler does not have the ability to determine which one is 
relevant.


More information about the Digitalmars-d mailing list