Sujet : Re: enum sets
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.cDate : 29. Aug 2024, 14:09:36
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <3be5b29ade1ce269874ab1ef8abf1bd666a7fc9c@i2pn2.org>
References : 1
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
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.
>
>
reading yet once i dont know what you want
i guess you maybe say what i understand as kinda "micro dictionary"
i mean say 32 bits of enum offes space to give some section for
"keys" and some section for "values" (for example upper 8 bits
for keys 1-255 enumized or not - and 24 bits for values - also enumized
or not...such microdictionary is good idea..i guess people
sometimes use it but in fact enum statement dont support it afair
though as i said the form of defining it
enum
{
AJHJH
{
KJHZ,
HJKJHG,
HJHJH,
}
AJJHKJH
{
KJHZ,
HJKJHG,
HJHJH,
}
}
may be probably bad becouse you want to have 2 keys so
it should be more like
enum A:shbshb
enum B:shbshbskjs
enum B:shbshbjskj
enum A:B:shbshbskjs