[Development] API style guide: scoped enum or not?

Marc Mutz marc.mutz at qt.io
Thu May 4 09:10:42 CEST 2023

On 04.05.23 00:18, Thiago Macieira wrote:
> On Wednesday, 3 May 2023 10:40:18 PDT Marc Mutz via Development wrote:
>> So if it's a vote: +1 for all new enums being scoped and +1 for all old
>> enums being made scoped come Qt 7.
> With the same trick that C++20 did for std::memory_order?

That's an additional step we can take, but if clang-tidy has a 
modernize-scope-enums (or we could write it), then it would be 
preferable to just automatically port all users instead of writing code 
that keeps unported code running. The main issue isn't the scoping, the 
main issue will be the missing implicit conversion to underlying_type.

Marc Mutz <marc.mutz at qt.io>
Principal Software Engineer

The Qt Company
Erich-Thilo-Str. 10 12489
Berlin, Germany

Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht Charlottenburg,
HRB 144331 B

More information about the Development mailing list