safe assign of int to enum

27 Mar
2006
27 Mar
'06
6:41 a.m.
Hello, is a technique available in boost in order to assign an int value to a enum? enum E { e1 = 1, e2 = 2, e3 = 3 }; E e( static_cast< E >( 1) ); // should work E e( static_cast< E >( 5) ); // should throw exception at runtime Regards, Oliver
6907
Age (days ago)
6907
Last active (days ago)
0 comments
1 participants
participants (1)
-
Oliver.Kowalke@infineon.com