Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

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.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap