D - BUG: Internal error: ..\ztc\out.c 1127
- davepermen (1/1) Feb 02 2004 playing with templates and aliases, i got
- davepermen (23/23) Feb 02 2004 damn:D wrong key..
- davepermen (12/35) Feb 02 2004 like this:
-
C
(5/52)
Feb 02 2004
Thats cool , wish we had a tutorial on D's templates
( - Walter (4/14) Feb 07 2004 Looks like the compiler is failing to catch the illegal reference to the
- davepermen (3/19) Feb 07 2004 exactly. (but it would be great if it would not be illegal:D)
damn:D wrong key..
well... playing with templates and aliased, i got
Internal error: ..\ztc\out.c 1127
in this code:
import std.c.stdio;
template max(T) {
T max(T a,T b) {
return a > b ? a : b;
}
}
template Max(alias A,alias B) {
typeof(A) Max() {
return 0; max!(typeof(A))(A,B);
}
}
int main(char[][] args) {
int a = 5;
int b = 10;
printf("Max(%i,%i) = %i" \n,a,b,Max!(a,b)); //max!(int)(5,10));
return getch();
}
i'd prefer to have a bether error message:D
btw, code can be reduced by much..
Feb 02 2004
like this:
template Foo(alias A) {
void Foo() {
}
}
int main(char[][] args) {
int a = 5;
Foo!(a);
return getch();
}
"davepermen" <davepermen hotmail.com> schrieb im Newsbeitrag
news:bvl2qg$2in$1 digitaldaemon.com...
damn:D wrong key..
well... playing with templates and aliased, i got
Internal error: ..\ztc\out.c 1127
in this code:
import std.c.stdio;
template max(T) {
T max(T a,T b) {
return a > b ? a : b;
}
}
template Max(alias A,alias B) {
typeof(A) Max() {
return 0; max!(typeof(A))(A,B);
}
}
int main(char[][] args) {
int a = 5;
int b = 10;
printf("Max(%i,%i) = %i" \n,a,b,Max!(a,b)); //max!(int)(5,10));
return getch();
}
i'd prefer to have a bether error message:D
btw, code can be reduced by much..
Feb 02 2004
Thats cool , wish we had a tutorial on D's templates <nudge,nudge> (
Foo!(nudge,nudge ) ? )
C
"davepermen" <davepermen hotmail.com> wrote in message
news:bvl2sj$2op$1 digitaldaemon.com...
like this:
template Foo(alias A) {
void Foo() {
}
}
int main(char[][] args) {
int a = 5;
Foo!(a);
return getch();
}
"davepermen" <davepermen hotmail.com> schrieb im Newsbeitrag
news:bvl2qg$2in$1 digitaldaemon.com...
damn:D wrong key..
well... playing with templates and aliased, i got
Internal error: ..\ztc\out.c 1127
in this code:
import std.c.stdio;
template max(T) {
T max(T a,T b) {
return a > b ? a : b;
}
}
template Max(alias A,alias B) {
typeof(A) Max() {
return 0; max!(typeof(A))(A,B);
}
}
int main(char[][] args) {
int a = 5;
int b = 10;
printf("Max(%i,%i) = %i" \n,a,b,Max!(a,b)); //max!(int)(5,10));
return getch();
}
i'd prefer to have a bether error message:D
btw, code can be reduced by much..
Feb 02 2004
"davepermen" <davepermen hotmail.com> wrote in message
news:bvl2sj$2op$1 digitaldaemon.com...
like this:
template Foo(alias A) {
void Foo() {
}
}
int main(char[][] args) {
int a = 5;
Foo!(a);
return getch();
}
Looks like the compiler is failing to catch the illegal reference to the
local 'a'.
Feb 07 2004
exactly. (but it would be great if it would not be illegal:D) "Walter" <walter digitalmars.com> schrieb im Newsbeitrag news:c03aj7$h3j$3 digitaldaemon.com..."davepermen" <davepermen hotmail.com> wrote in message news:bvl2sj$2op$1 digitaldaemon.com...like this: template Foo(alias A) { void Foo() { } } int main(char[][] args) { int a = 5; Foo!(a); return getch(); }Looks like the compiler is failing to catch the illegal reference to the local 'a'.
Feb 07 2004









"C" <dont respond.com> 