[Development] Naming convention for (scoped) enums

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Tue Aug 14 13:18:15 CEST 2018


> On 14 Aug 2018, at 13:13, Eike Ziller <Eike.Ziller at qt.io> wrote:
> 
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf states the problems that were the driver for creating strongly typed enums:
> 
> 1. Implicit conversion to integer
> 2. Inability to specify underlying type

https://en.cppreference.com/w/cpp/language/enum describes types for unscoped enums too, curious, what’s the difference for the scoped enums?

> 3. Scoping
> 
>> that specifically mentions the enum inside a class use case a primary driver?
> 
> Why would the implicit conversion problem be any different for enums inside a class?

It wouldn’t. I was referring to the scoping/name clash, which is what this discussion has been largely focusing on (so far).

Tor Arne 


More information about the Development mailing list