enum scope

Daniel Murphy yebblies at nospamgmail.com
Thu Jan 26 22:30:34 PST 2012


> alias int UITableViewRowAnimation;
> enum
> {
> UITableViewRowAnimationFade,
> UITableViewRowAnimationRight,
> UITableViewRowAnimationLeft,
> UITableViewRowAnimationTop,
> UITableViewRowAnimationBottom,
> UITableViewRowAnimationNone,
> UITableViewRowAnimationMiddle,
> UITableViewRowAnimationAutomatic = 100
> }

That works for interfacing c, but not c++.

The following is a better solution, and should probably be in the standard 
library.

enum UITableViewRowAnimation
{
  UITableViewRowAnimationFade,
  UITableViewRowAnimationRight,
  UITableViewRowAnimationLeft,
  UITableViewRowAnimationTop,
  UITableViewRowAnimationBottom,
  UITableViewRowAnimationNone,
  UITableViewRowAnimationMiddle,
  UITableViewRowAnimationAutomatic = 100
}
alias UITableViewRowAnimation.UITableViewRowAnimationFade 
UITableViewRowAnimationFade;
alias UITableViewRowAnimation.UITableViewRowAnimationRight 
UITableViewRowAnimationRight;
alias UITableViewRowAnimation.UITableViewRowAnimationLeft 
UITableViewRowAnimationLeft;
alias UITableViewRowAnimation.UITableViewRowAnimationTop 
UITableViewRowAnimationTop;
alias UITableViewRowAnimation.UITableViewRowAnimationBottom 
UITableViewRowAnimationBottom;
alias UITableViewRowAnimation.UITableViewRowAnimationNo 
UITableViewRowAnimationNo;
alias UITableViewRowAnimation.UITableViewRowAnimationMiddle 
UITableViewRowAnimationMiddle;
alias UITableViewRowAnimation.UITableViewRowAnimationAutomatic 
UITableViewRowAnimationAutomatic;

(could be mixin(exposeEnumMembers!UITableViewRowAnimation); ) 




More information about the Digitalmars-d mailing list