Sujet : Re: enum sets
De : thiago.adams (at) *nospam* gmail.com (Thiago Adams)
Groupes : comp.lang.cDate : 29. Aug 2024, 12:37:30
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vapmhq$3ullf$3@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 29/08/2024 05:18, fir wrote:
Thiago Adams wrote:
I am wondering how useful would be to have enum sets.
>
Let´s say you have a function that accepts only monospaced fonts.Then
you can use enum monospaced_font_type. Or a switch case where you need
to check all and only monospaced_font_type.
>
But at same type you can store at same object monospaced_font_type or
font_type.
>
enum font_type
{
enum monospaced_font_type
{
CASCADIA_FONT,
},
ARIAL_FONT
};
>
This could be arranged in any way.
>
>
this is about general problem of what i name polymorphism
I was considering the name polymorphic enum. But polymorphism is more about hierarchies.
For this feature it can be any set you want. We can have duplicates.
enum E
{
enum set1 {
A
},
enum set2 {
A,
B
}
}