view run/t/tuple_20_A.d @ 1564:1d41f2132ef4

r8717@birke: tk | 2007-09-30 10:45:56 +0200 [Issue 1532] Template instance cannot use class locals as template parameters <samukha@voliacable.com> 2007-09-07 http://d.puremagic.com/issues/show_bug.cgi?id=1532
author thomask
date Sun, 30 Sep 2007 09:46:24 +0000
parents 20d8ee6523e1
children
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	Nick <korslund@gmail.com>
// @date@	2007-02-06
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=933
// @desc@	[Issue 933] Literal tuple parameters fails to compile when inout is mentioned

module dstress.run.t.tuple_20_A;

int x;

struct Foo(T...){
	void set(T t){
		x += t[0];
	}

	void get(ref T t){
		x *= t[0];
	}
}

int main(){
	Foo!(int) foo;
	foo.set(5);
	if(5 != x){
		assert(0);
	}

	return 0;
}