www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - signatures

reply "voyager" <voyager voyager.com> writes:
is there some thing like typedef?

alias int XXX;
alias int YYY;

void a1(XXX a, YYY b) {int c = a+b;}
void a1(int a, YYY b) {int c = a+b;}


gives an error:
Building Debug\bgitest.exe...
bgitest.obj : fatal error LNK1179: invalid or corrupt file: 
duplicate COMDAT '_D4main2a1FiiZv (void main.a1(int, int))'
Building Debug\bgitest.exe failed!
Details saved as 
"file://G:\PROGRAMMING\DPROG\bgitest\bgitest\Debug\bgitest.buildlog.html"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped 
==========
Feb 21 2014
parent reply "Brad Anderson" <eco gnuk.net> writes:
On Friday, 21 February 2014 at 23:46:10 UTC, voyager wrote:
 is there some thing like typedef?

 alias int XXX;
 alias int YYY;

 void a1(XXX a, YYY b) {int c = a+b;}
 void a1(int a, YYY b) {int c = a+b;}


 gives an error:
 Building Debug\bgitest.exe...
 bgitest.obj : fatal error LNK1179: invalid or corrupt file: 
 duplicate COMDAT '_D4main2a1FiiZv (void main.a1(int, int))'
 Building Debug\bgitest.exe failed!
 Details saved as 
 "file://G:\PROGRAMMING\DPROG\bgitest\bgitest\Debug\bgitest.buildlog.html"
 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 
 skipped ==========
http://dlang.org/phobos/std_typecons.html#Typedef
Feb 21 2014
parent "voyager" <voyager voyager.com> writes:
thanks. works nice
Feb 21 2014