Sign in to follow this  
SiddharthBhat

Enum to Integer?

Recommended Posts

SiddharthBhat    358

Hi all!

 

Is there any way to typecast an Enum to a raw integer in angelScript? I've tried using C's typecast syntax and the cast operator. neither worked :/.  Some more suggestions?  

 

thanks

~Bollu 

 

 

Share this post


Link to post
Share on other sites
WitchLord    4678

The enums are implicitly converted to integers by the compiler, but if you want to explicitly do the conversion you may use the C++ style cast (not C style).

 

enum E { VALUE = 1 }
int a = int(VALUE);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this