Re: is(T == const) for function types

2012-12-26 Thread mist
On Wednesday, 26 December 2012 at 00:47:28 UTC, Ali Çehreli wrote: 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, bearophilee Hmmm. I think the compiler is right. That const that is applied

is(T == const) for function types

2012-12-25 Thread mist
http://dpaste.dzfl.pl/0cda8d0f bug or feature?

Re: is(T == const) for function types

2012-12-25 Thread Ali Çehreli
On 12/25/2012 12:59 PM, mist wrote: http://dpaste.dzfl.pl/0cda8d0f bug or feature? For convenience to others, here is your code: struct Test { void delegate() const deleg; } void main() { static assert( is(typeof(Test.deleg) == const) ); } I don't know the answer but this works:

Re: is(T == const) for function types

2012-12-25 Thread bearophile
Ali Çehreli: I don't know the answer but this works: That difference smells of compiler bug :-) Bye, bearophile

Re: is(T == const) for function types

2012-12-25 Thread Ali Çehreli
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

Re: is(T == const) for function types

2012-12-25 Thread bearophile
Ali Çehreli: 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: You seem right. The positional syntax of those tags tricks me sometimes still. Bye, bearophile