Plain enum to enum class

Viewed 85

is it possible to perform some kind of casting to convert plain enum to enum class? E.g.

enum PlainEnum {
None = 0,
Foo,
Bar
}

Some converstion I'm looking for:

enum class ScopedEnum = some_cast<enum class>(PlainEnum);

Desired Output:

enum class ScopedEnum {
None = 0,
Foo,
Bar
};

I use a library where the enum is written in non-scoped style. I would like to use these library enum fields but in scoped style. I haven't found any asnwer on that question yet. Thank you for your time.

0 Answers
Related