October 09, 2013 Error: struct Foo(T = int) is used as a type | ||||
|---|---|---|---|---|
| ||||
----
import std.stdio;
struct Foo(T = int) { }
void main()
{
Foo f;
}
----
Error: Error: struct Foo(T = int) is used as a type
If I change Foo f into Foo!() f it works. Is the compiler not able to see that this is not necessary, since I have a default type?
| ||||
October 10, 2013 Re: Error: struct Foo(T = int) is used as a type | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Namespace | I wondered the same thing a couple of weeks back. It seems to work this way to avoid certain ambiguities. Related bug report / discussion: http://d.puremagic.com/issues/show_bug.cgi?id=1012 | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply