<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Can you give some examples of where it should be fixed?</span></div><div><br><span></span></div><div><span>-Steve<br></span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Lars Tandle Kyllingstad <lars@kyllingen.net><br><b><span style="font-weight: bold;">To:</span></b> Phobos mailing list <phobos@puremagic.com><br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, May 19, 2011 11:11 AM<br><b><span style="font-weight: bold;">Subject:</span></b> [phobos] isClass!T<br></font><br>
Several places in Phobos I've noticed tests like if(is(T==class)) that<br>check whether T is a class type. I suspect it is usually meant for<br>these tests to pass if T is an interface as well, but this is not the<br>case. Doing<br><br> grep 'is(\w\+\s*==\s*class)' *.d<br><br>on the Phobos sources reveals many cases where the test for<br>is(T==interface) has most likely been forgotten. This should be fixed,<br>and I think the best way is to add the following to std.traits:<br><br> template isClass(T)<br> {<br> enum isClass = is(T == class) || is(T == interface);<br> }<br><br>Most instances of is(T==class) in Phobos can then be replaced with<br>isClass!T.<br><br>What say you?<br><br>-Lars<br><br>_______________________________________________<br>phobos mailing list<br><a ymailto="mailto:phobos@puremagic.com"
href="mailto:phobos@puremagic.com">phobos@puremagic.com</a><br>http://lists.puremagic.com/mailman/listinfo/phobos<br><br><br></div></div></blockquote></div></div></body></html>