On 17.01.25 16:52, Allan Sandfeld Jensen wrote:
> Did anyone ever suggest or put pressure on the C++ standard committee to add
> strong unscoped enums?

Someone did:

// https://gcc.godbolt.org/z/69zWsoGP9
     enum class Strong { One, Two, Three };
  #ifdef __cpp_using_enum
     using enum Strong;
  #else
     inline constexpr auto One = Strong::One;
     inline constexpr auto Two = Strong::Two;
     inline constexpr auto Three = Strong::Three;
  #endif
     use(One); use(Two); use(Three);

The ice for unscoped enums becomes _very_ thin.

-- 
Marc Mutz <marc.m...@qt.io> (he/his)
Principal Software Engineer

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

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

-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to