Mercurial > projects > dstress
annotate run/default_argument_06.d @ 139:9eda85342d8a
1) templated default arguments
tetsuya <tetsuya_member@pathlink.com>
news://cnaidd$2rnr$1@digitaldaemon.com
nntp://digitalmars.com/digitalmars.D.bugs:2275
author | thomask |
---|---|
date | Mon, 15 Nov 2004 18:07:14 +0000 |
parents | |
children | a33ad7189d21 |
rev | line source |
---|---|
139 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @uri@ news://cnaidd$2rnr$1@digitaldaemon.com | |
6 // @autor@ tetsuya <tetsuya_member@pathlink.com> | |
7 // @date@ 2004-11-15 | |
8 // @url@ nttp://digitalmars.com/digitalmars.D.bugs:2275 | |
9 | |
10 module dstress.run.default_argument_06; | |
11 | |
12 template Template(int L){ | |
13 int i=L; | |
14 int test(int b = i) { | |
15 return b; | |
16 } | |
17 } | |
18 | |
19 int main(){ | |
20 mixin Template!(10); | |
21 assert(test()==10); | |
22 return 0; | |
23 } |