enum scope
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Sat Jun 7 16:50:00 PDT 2014
On 1/26/2012 3:55 AM, Michel Fortin wrote:
> Often C enum value naming takes into account that they'll live in the outer
> scope. For instance:
>
> enum UITableViewRowAnimation {
> UITableViewRowAnimationFade,
> UITableViewRowAnimationRight,
> UITableViewRowAnimationLeft,
> UITableViewRowAnimationTop,
> UITableViewRowAnimationBottom,
> UITableViewRowAnimationNone,
> UITableViewRowAnimationMiddle,
> UITableViewRowAnimationAutomatic = 100
> }
>
> So if you're doing direct bindings where you don't want to change the names,
Enums are not part of the C ABI.
> how do you use that in D?
>
> UITableViewRowAnimation.UITableViewRowAnimationFade
>
enum UITableViewRowAnimation {
Fade,
Right,
Left,
Top,
Bottom,
None,
Middle,
Automatic = 100
}
ITableViewRowAnimation.Fade
More information about the Digitalmars-d
mailing list