view nocompile/template_05.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents 774e02c900da
children
line wrap: on
line source

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

// @author@	=?iso-8859-1?q?Knud_S=F8rensen?= <knud@NetRunner.all-technology.com>
// @date@	2004-05-30
// @uri@	news:pan.2004.05.30.19.54.44.280109@NetRunner.all-technology.com
// @uri@	http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=329

// __DSTRESS_ELINE__ 34

module dstress.nocompile.template_05;

template pow(x, int n){ 
	static assert(n>=0);
	enum {
		pow = pow!(x,n % 2) * pow!(x*x,n/2)
	} 
} 

template pow(x,int n:1) {
	enum{
		pow= x
	}
}
 
template pow(x,int n:0) {
	enum {
		pow= 1
	}
} 

int main(){
	pow!(3,4);
	return 0;
}