Is this is bug or not?
Thomas Kuehne
thomas-dloop at kuehne.cn
Wed Mar 15 12:51:29 PST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Victor Nakoryakov schrieb am 2006-03-11:
> 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?
Added to DStress as
http://dstress.kuehne.cn/run/t/template_31_A.d
http://dstress.kuehne.cn/run/t/template_31_B.d
http://dstress.kuehne.cn/run/t/template_31_C.d
http://dstress.kuehne.cn/run/t/template_31_D.d
template_31_C seems funny, but I'm not aware of any statement against
it.
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFEGIva3w+/yD4P9tIRAmqnAKCE2FIpTVzbn1maO+6BE6gPkBwDcgCgxT/3
gZtWcBij/IxJZgY31hPA+M8=
=vke5
-----END PGP SIGNATURE-----
More information about the Digitalmars-d
mailing list