Thread overview | |||||
---|---|---|---|---|---|
|
August 11, 2011 Why enum of structs are not initialised? | ||||
---|---|---|---|---|
| ||||
code: private struct request_variant { package: immutable string sql_query; } enum test : request_variant { current_time = request_variant( "SELECT now()" ), //users = { sql_query: "SELECT 'users list'::text" } } causes syntax error if I am uncommit second string in enum |
August 11, 2011 Re: Why enum of structs are not initialised? | ||||
---|---|---|---|---|
| ||||
Posted in reply to mimocrocodil | mimocrocodil:
> causes syntax error if I am uncommit second string in enum
I think D enums are mostly meant for enumerations, of things like ints, ushorts, chars, etc. (But enhancement requests are possible).
Also is that "package:" actually working?
Bye,
bearophile
|
August 11, 2011 Re: Why enum of structs are not initialised? | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Thursday, August 11, 2011 13:18 bearophile wrote: > mimocrocodil: > > causes syntax error if I am uncommit second string in enum > > I think D enums are mostly meant for enumerations, of things like ints, ushorts, chars, etc. (But enhancement requests are possible). That's incorrect. TDPL specifically talks about using structs as the type of an enum. However, there are bugs with it which make it so that it doesn't really work at the moment. Among them are: http://d.puremagic.com/issues/show_bug.cgi?id=4423 http://d.puremagic.com/issues/show_bug.cgi?id=5460 If you see any bugs with regards to structs not working as enum values, please report them if you can't find them in bugzilla. - Jonathan M Davis |
Copyright © 1999-2021 by the D Language Foundation