Thread overview
foo is not an lvalue
Apr 18, 2013
Ellery Newcomer
Apr 18, 2013
bearophile
Apr 18, 2013
Ellery Newcomer
April 18, 2013
void main() {
    foo!();
}

template foo( ) {
    void foo() {
        auto a = (&foo);
    }
}

dmd from master (a few days ago) gives:

 Error: foo()() is not an lvalue


wut?
April 18, 2013
Ellery Newcomer:

> dmd from master (a few days ago) gives:
>
>  Error: foo()() is not an lvalue
>
>
> wut?

I think you need to write:

auto a = &foo!();

Bye,
bearophile
April 18, 2013
On 04/17/2013 06:02 PM, bearophile wrote:
> Ellery Newcomer:
>
>> dmd from master (a few days ago) gives:
>>
>>  Error: foo()() is not an lvalue
>>
>>
>> wut?
>
> I think you need to write:
>
> auto a = &foo!();
>
> Bye,
> bearophile

wouldn't that be infinitely recursing template instantiation?