Unable to understand this compiler error

Lubos Pintes lubos.pintes at gmail.com
Wed Oct 10 09:59:30 PDT 2012


Interesting. In treeview module I mentioned, there is an enum containing 
some numeric values cast from HTREEITEM, which is in fact HANDLE, which 
is void* if I understand properly.
I tried to convert DGUI to use dsource' WindowsAPI project, and at least 
from compiler perspective, everything worked except this TreeView 
weirdness...

Dňa 10. 10. 2012 17:51 bearophile  wrote / napísal(a):
> Lubos Pintes:
>
>> I see no "void" there, except that foo has a return type of void.
>
> Minimized:
>
> enum Foo : void* {
>      a = null
> }
> void main() {
>      auto f = Foo.a;
> }
>
>
> enums are good for ints, ubytes, longs, chars, etc. The more types you
> try to put in them, the more compiler holes you will find.
>
> Bye,
> bearophile



More information about the Digitalmars-d-learn mailing list