Sujet : Re: enum sets
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.cDate : 29. Aug 2024, 09:30:07
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vapbid$3tb2u$1@raubtier-asyl.eternal-september.org>
References : 1
User-Agent : Mozilla Thunderbird
Am 29.08.2024 um 01:42 schrieb Thiago Adams:
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.
Use C++:
struct font_type
{
struct monospaced_font_type
{
static constexpr int CASCADIA_FONT = 123;
};
static constexpr int ARIAL_FONT = 456;
};