advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
Rate this item | 0 users have rated this item.
 

Safeguard Your enums: Make Them Strongly-Typed

Find out how the newly standardized strongly-typed enum types resolve long-standing bugs and security loopholes.  


advertisement
num types have been a valuable asset in the arsenal of C++ programmers for many years. However, their current specification has some security loopholes that can lead to bugs and portability problems. Recently, the C++ standards committee accepted a new proposal for strongly typed enum types. As with all other C++09 proposals, it may take some time before your compiler supports this feature, but it's not a moment too soon to learn how to use this feature or how to make your code C++09-ready.


How can you avoid implicit conversions of enumerators to integral types? Or specify the exact underlying type for a certain enum?


Use C++09 strongly-typed enums.

  Next Page: Implicit Conversions
Page 1: IntroductionPage 3: enum Classes
Page 2: Implicit Conversions 
Please rate this item (5=best)
 1  2  3  4  5
advertisement