On Friday 17 January 2025 22:52:04 Central European Standard Time Marc Mutz via Development wrote: > 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.
Sure, when we can ask users to depend on C++20 Best regards Allan -- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development