Is this is bug or not?

Victor Nakoryakov Victor_member at pathlink.com
Sat Mar 11 05:46:16 PST 2006


Hi all,

Here is a snipet:

import std.stdio;

struct A(T, T x0)
{
T x = x0;
}

int main(char[][] args)
{
alias A!(int, 8) Ai; // test.d(11)
Ai ai;
writefln(ai.x);
return 0;
}

DMD output is:
test.d(11): template instance A!(int,8) does not match any template declaration

However snipet:

import std.stdio;

struct A(T, int x0) // note int instead of T
{
T x = x0;
}

int main(char[][] args)
{
alias A!(int, 8) Ai;
Ai ai;
writefln(ai.x);
return 0;
}

works as expected. Is former is a templates issue or bug?

--
Victor Nakoryakov (aka nail)
nail-mail[at]mail.ru

Krasnoznamensk, Moscow, Russia



More information about the Digitalmars-d mailing list