On 2009-10-09 15:01:30 -0400, Andrei Alexandrescu
<[email protected]> said:
static if (is(typeof({
auto t = new T;
})))
I'm in awe. Thanks, Jacob!!!
Andrei
Oh, wait, that doesn't work:
class A {}
class B : A { this(int) {} }
A a = new B;
clear(a); // oops
It would work, but only as a (virtual) member function redefined for
every subclass. Much like a 'clone' method. Sufficient runtime
reflection could work too to aleviate that, but it'd execute slower.
--
Michel Fortin
[email protected]
http://michelf.com/