[Issue 12484] Template Overloading or Pattern Matching Failure

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 27 15:32:26 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12484


monkeyworks12 at hotmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


--- Comment #1 from monkeyworks12 at hotmail.com 2014-03-27 15:32:25 PDT ---
And I just realized that the error is mine. The extra n parameter must go at
the end or template inference can't figure it out, of course. This works:

struct Cmp(x: Zero,   y: Succ!n, c: Less,    n) {}
struct Cmp(x: Succ!n, y: Zero,   c: Greater, n) {}


void main()
{
    assert(is(Cmp!(Zero, Zero, Equal)));   //Ok
    assert(is(Cmp!(Zero, One,  Less)));    //Ok
    assert(is(Cmp!(One,  Zero, Greater))); //Ok
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list