Date: Mon, 20 Apr 2026 16:30:47 +0500
I would highly suggest for you to tell the exact issue that you have with
current enums. Start with an example that you think takes too much
boilerplate code, then we can work on a wrapper and determine is such
wrappers should be standardized.
Regards, Muneem.
On Mon, 20 Apr 2026, 3:47 pm Andrey Fokin via Std-Proposals, <
std-proposals_at_[hidden]> wrote:
> Title: Pxxxx: Add inheritance for Enum Class enumerations
> Author: Andrey Fokin, lazzyfox_at_[hidden]
> Date: 2026-04-20
> Project: Programming Language C++, Library Working Group
> Abstract: New inheritance feature to enum class (scoped enumerations)
> 1. Introduction
> According my experience the are situations when scped enumerations could
> be presented in OOP style – base enumeration type and some ancestors of.
> For example – we have to define a list of colors for traffic lights device.
> Is simple case we have just three colors and our enum could looks like
> enum class TrafficLight:uint8_t { Red, Yellow, Green };
> And probably this enum will cover biggest part of cases. But if we need to
> have a case wit Trafficligt wit left, rgih or two arrows we need ot use
> three diffeerent data types for each with big part of duplicated data in
> eatch.
> Case 1- additional letf arrow enum class TrafficLight_LefatArrow:uint8_t {
> Red, Yellow, Green, LeftArrow };
> Case 2- additional right arrow enum class TrafficLight_RightArrow:uint8_t
> { Red, Yellow, Green, RightArrow };
> Case 3- two additional arrows enum class TrafficLight_TwoArrows:uint8_t {
> Red, Yellow, Green, LeftArrow, RightArrow };
>
> In case of inheritance could be possible use as first case as a base class
> and athers as inherited to exclude overlapping data duplication and casese
> above cold looks like
> Case 4- additional letf arrow enum class TrafficLight:LefatArrow:uint8_t
> {LeftArrow };
> Case 5- additional right arrow enum class TrafficLight:RightArrow:uint8_t
> {RightArrow };
> Case 6- two additional arrows enum class TrafficLight_TwoArrows:uint8_t
> {LeftArrow, RightArrow };
>
> 2. Motivation and scope
> Proposal could make more cleare code structure and decrease code
> overlapping and had writing
> 3. Design decisions
> It could be compiler extension
>
>
>
>
> BRG,
> Andrey
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
current enums. Start with an example that you think takes too much
boilerplate code, then we can work on a wrapper and determine is such
wrappers should be standardized.
Regards, Muneem.
On Mon, 20 Apr 2026, 3:47 pm Andrey Fokin via Std-Proposals, <
std-proposals_at_[hidden]> wrote:
> Title: Pxxxx: Add inheritance for Enum Class enumerations
> Author: Andrey Fokin, lazzyfox_at_[hidden]
> Date: 2026-04-20
> Project: Programming Language C++, Library Working Group
> Abstract: New inheritance feature to enum class (scoped enumerations)
> 1. Introduction
> According my experience the are situations when scped enumerations could
> be presented in OOP style – base enumeration type and some ancestors of.
> For example – we have to define a list of colors for traffic lights device.
> Is simple case we have just three colors and our enum could looks like
> enum class TrafficLight:uint8_t { Red, Yellow, Green };
> And probably this enum will cover biggest part of cases. But if we need to
> have a case wit Trafficligt wit left, rgih or two arrows we need ot use
> three diffeerent data types for each with big part of duplicated data in
> eatch.
> Case 1- additional letf arrow enum class TrafficLight_LefatArrow:uint8_t {
> Red, Yellow, Green, LeftArrow };
> Case 2- additional right arrow enum class TrafficLight_RightArrow:uint8_t
> { Red, Yellow, Green, RightArrow };
> Case 3- two additional arrows enum class TrafficLight_TwoArrows:uint8_t {
> Red, Yellow, Green, LeftArrow, RightArrow };
>
> In case of inheritance could be possible use as first case as a base class
> and athers as inherited to exclude overlapping data duplication and casese
> above cold looks like
> Case 4- additional letf arrow enum class TrafficLight:LefatArrow:uint8_t
> {LeftArrow };
> Case 5- additional right arrow enum class TrafficLight:RightArrow:uint8_t
> {RightArrow };
> Case 6- two additional arrows enum class TrafficLight_TwoArrows:uint8_t
> {LeftArrow, RightArrow };
>
> 2. Motivation and scope
> Proposal could make more cleare code structure and decrease code
> overlapping and had writing
> 3. Design decisions
> It could be compiler extension
>
>
>
>
> BRG,
> Andrey
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
Received on 2026-04-20 11:31:00
