Compiler can't deduce type for template struct Pair when using it with enum argument. There is an example

import std.stdio;

enum Category { first, second, third };

struct Pair(F, S)
{
        F first;
        S second;
        
        this(F f, S s)
        {
                first = f;
                second = s;
        }
}


void main()
{
        auto p = Pair(Category.first, "first"); //It fails
        
        writeln(p);
}

Is it not working for some reason or I'm doing something wrong or is it just lack of implementation? How I could make this working without explicit specifying of types?

Reply via email to