Can you give some examples of where it should be fixed?

-Steve




>________________________________
>From: Lars Tandle Kyllingstad <[email protected]>
>To: Phobos mailing list <[email protected]>
>Sent: Thursday, May 19, 2011 11:11 AM
>Subject: [phobos] isClass!T
>
>Several places in Phobos I've noticed tests like if(is(T==class)) that
>check whether T is a class type.  I suspect it is usually meant for
>these tests to pass if T is an interface as well, but this is not the
>case.  Doing
>
>  grep 'is(\w\+\s*==\s*class)' *.d
>
>on the Phobos sources reveals many cases where the test for
>is(T==interface) has most likely been forgotten.  This should be fixed,
>and I think the best way is to add the following to std.traits:
>
>  template isClass(T)
>  {
>      enum isClass = is(T == class) || is(T == interface);
>  }
>
>Most instances of is(T==class) in Phobos can then be replaced with
>isClass!T.
>
>What say you?
>
>-Lars
>
>_______________________________________________
>phobos mailing list
>[email protected]
>http://lists.puremagic.com/mailman/listinfo/phobos
>
>
>
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to