Why enum instead of enum class?
-
Friday, September 28, 2012 12:12 AM
Since I started coding in C++11 I prefer declaring my enums as enum class (specifying the storage type i.e. enum class X:unsigned short{a,b,c}) so enforcing that only that type is allowed... Of course you can static_cast, but, not only i feel more confident on defining functions that accept a enum class, but also is a lot easier and obvious to write and read a value fot that parameter.
Why don't you use enum class in Casablanca classes/functions since this is a C++11 library anyway?
(sorry if this is a newbie question)
Thanks in advance for the clarification
Fernando
All Replies
-
Friday, September 28, 2012 2:41 AMOwner
Visual Studio 2010 does not support it and we very dearly wanted Casablanca to work with that version of VS, too.
Niklas
- Marked As Answer by Fernando M Friday, September 28, 2012 7:51 AM

