changeset 539:a3c3ff62b051

mixin / class member / this David Friedman <d3rdclsmail_a_@_t_earthlink_d_._t_net> 2005-05-04 news:d595ii$lqr$1@digitaldaemon.com
author thomask
date Sat, 14 May 2005 07:05:51 +0000
parents 5320be2851e8
children f046e2368dc8
files run/m/mixin_13.d
diffstat 1 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/m/mixin_13.d	Sat May 14 07:05:51 2005 +0000
@@ -0,0 +1,38 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	David Friedman <d3rdclsmail_a_@_t_earthlink_d_._t_net>
+// @date@	2005-05-04
+// @uri@	news:d595ii$lqr$1@digitaldaemon.com
+
+module dstress.run.m.mixin_13;
+
+int status;
+
+class C {
+	template T(alias f) {
+		void check(){
+			f();		
+			assert(status++==2);
+		}
+	}
+
+	void test(){
+		assert(status++==1);
+	}
+
+	void run() {
+		assert(status++==0);
+		mixin T!(test) x;
+		x.check();
+		assert(status++==3);
+	}
+}
+
+int main(){
+	C c = new C;
+	c.run();
+	assert(status==4);
+	return 0;
+}