Mixins are not inherited?

Namespace rswhite4 at googlemail.com
Thu May 3 16:05:26 PDT 2012


Very sad, i thougth that was possible.

As regards to "instanceof"

Try this code:

unittest {
	class A {
		mixin TRef!(typeof(this));
	}

	class B : A { }

	class C : B { }

	A a1 = new B();
	A a2 = new C();

	assert(instanceof!(A)(a1) == false);
	assert(instanceof!(B)(a1));
	assert(instanceof!(C)(a1) == false);
}

with my instanceof and then with your version.


More information about the Digitalmars-d-learn mailing list