[Development] API style guide: scoped enum or not?
Allan Sandfeld Jensen
kde at carewolf.com
Thu Jun 15 23:20:15 CEST 2023
On Mittwoch, 14. Juni 2023 22:53:13 CEST Thiago Macieira wrote:
> On Wednesday, 14 June 2023 12:49:22 PDT Allan Sandfeld Jensen wrote:
> > As discussed earlier. Better naming in many cases until we can depend on
> > C++20 in API.
>
> There's nothing in C++20 that would allow us to design APIs differently.
>
> You may be thinking of C++23 "using enum" feature, which is barely supported
> anywhere and doesn't help us in any way I can see. It might allow us in the
> future to change our existing unscoped enums to scoped, but until then
> there's little we ca do.
>
Correct. I was referring to "using enum", which had been referred to as C++20
by Marc. It could allow "type safe" enums without scope.
But yes, I don't think that is relevant right now, which is why I prefer to
keep the cleaner API where scoping doesn't make sense.
Best regards
Allan
More information about the Development
mailing list