is expression for template structs/classes instances?

d coder dlang.coder at gmail.com
Tue Dec 21 02:57:45 PST 2010


> I do know the template. I will try out your solution. Will let you
> know if I face issues.
>

Simen

It works perfect, And this is exactly what I was looking for. If you
see my original post, I also thought this form of "is" expression
should work. Just could not get around to the right syntax.

With your help it is working now. I am using a slightly more elaborate
check which is obvious but I am writing it here to just let the list
know.

static if ( is( typeof(foo) f == S!T, T : int) ) {
  // foo is an object of type S!T
  // where T is convertible to int
}

Thanks once more
Warm Regards
- Cherry


More information about the Digitalmars-d-learn mailing list