is(T == const) for function types

Ali Çehreli acehreli at yahoo.com
Tue Dec 25 16:47:28 PST 2012


On 12/25/2012 04:13 PM, bearophile wrote:
> Ali Çehreli:
>
>> I don't know the answer but this works:
>
> That difference smells of compiler bug :-)
>
> Bye,
> bearophile

Hmmm. I think the compiler is right. That const that is applied "at the 
end" in that syntax is I think allowed only for member functions. 
Otherwise these two work as well:

     // These work:
     const(void delegate()) deleg;
     const void delegate() deleg;

     // This is a compilation error:
     void delegate() const deleg;


Ali


More information about the Digitalmars-d-learn mailing list