Mercurial > projects > dstress
changeset 504:d913fdad80b5
alias const char[] <-> const char[] as case condition
zwang <nehzgnaw@gmail.com>
2005-05-01
news:d5247u$28ch$2@digitaldaemon.com
author | thomask |
---|---|
date | Tue, 10 May 2005 23:41:09 +0000 |
parents | 3205f4fe859c |
children | b801cf45a560 |
files | run/switch_22.d |
diffstat | 1 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/switch_22.d Tue May 10 23:41:09 2005 +0000 @@ -0,0 +1,26 @@ +// $HeadURL: http://dstress.kuehne.cn/run/switch_22.d $ +// $Date: 2005-05-03 21:07:03 +0200 (Di, 03 Mai 2005) $ +// $Author: thomask $ + +// @author@ zwang <nehzgnaw@gmail.com> +// @date@ 2005-05-01 +// @uri@ news:d5247u$28ch$2@digitaldaemon.com + +module dstress.run.switch_22; + +int main(char[][] args){ + if(args.length<int.max){ + args[0]="test"; + } + + alias const char[] cChar; + cChar c = "test"; + + switch(args[0]){ + case c: + break; + default: + assert(0); + } + return 0; +}