On Tuesday, 1 July 2014 at 05:58:19 UTC, Uranuz wrote:
Thanks for quick response. I really forget to look into language __traits statement.

Another option:

enum isFoo(T) = is(T == Foo!P, P...);

By using such an is-expression you get the parameters Foo was instantiated with as an added bonus.

struct Foo(T)
{
        T val;  
}

auto createAFoo(T)(string s)
if(is(T == Foo!P, P))
{
        return T(s.to!P);
}

Reply via email to