C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Add inheritance for Enum Class enumerations

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Tue, 28 Apr 2026 15:40:48 +0200
Hi Muneem, the use of your current code (what you linked) is enum class A { voilet, blue, roses, red}; constexpr A enum_obj= A::blue; Enum_wrapper B{enum_obj}; Enum_wrapper_complete wrap{B}; Can B define additional values for the enum class A? E.g. any of { yellow, white, green } in addition to the ones for A? I think that is the main reason for inheritance of enum classes to extend the possible values.

Received on 2026-04-28 13:42:41