enum scope
Jacob Carlborg
doob at me.com
Wed Jan 25 23:42:17 PST 2012
On 2012-01-26 02:06, Trass3r wrote:
> When writing C bindings I usually create lots of aliases via a string
> mixin to pull enum members into the enclosing scope so it's compatible
> to C.
> Would it be wise to let the compiler do this automatically for extern(C)
> enums?
You can use anonymous enums. The members will then live in the global
scope. You can then use just one alias to an int, uint or what's
appropriate.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list