view compile/t/template_44_A.d @ 1145:8c53d3cfa6f6

[Issue 351] New: Recursive string template doesn't work if the terminating specialisation is given first Stewart Gordon <smjg@iname.com> 2006-09-16 news:bug-351-3@http.d.puremagic.com/issues/
author thomask
date Wed, 20 Sep 2006 19:11:17 +0000
parents
children daef239f37cf
line wrap: on
line source

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

// @author@	Stewart Gordon <smjg@iname.com>
// @date@	2006-09-16
// @uri@	news:bug-351-3@http.d.puremagic.com/issues/
// @desc@	[Issue 351] New: Recursive string template doesn't work if the terminating specialisation is given first

module dstress.compile.t.template_44_A;

template Reverse(char[] s) {
	const char[] Reverse = Reverse!(s[1 .. s.length]) ~ s[0];
}

template Reverse(char[] s : "") {
	const char[] Reverse = "";
}

static assert(Reverse!("abcD") == "Dcba");