Template expansion bug?

Simen Kjaeraas simen.kjaras at gmail.com
Fri May 31 10:18:13 PDT 2013


On 2013-05-31, 16:42, Steven Schveighoffer wrote:

> While doing some testing, I came across this behavior:
>
> template foo(T) {
>      void foo() {}
> }
>
> void main()
> {
>      foo!(int).foo();
>      //foo!(int)(); // this works
> }

I'm not certain, but it could be ambiguity:

template foo(T) {
     struct foo {
         T foo;
     }
}

auto bar = foo!int.foo; // Is bar an int or a foo!int struct?

-- 
Simen


More information about the Digitalmars-d mailing list