Sujet : Re: enum sets
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.cDate : 29. Aug 2024, 14:37:43
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <025bd7e883b83b4c46e49664bf7287eeaf1c10f8@i2pn2.org>
References : 1 2
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
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.
>
>
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
>
>
wonder if such micro dictionary should hovever be called enom
it is dictionary but micro
dict T1 'a' = 0x8989 , 'b' = 0x2989 , 'c' = 0x8289 ,t T1 'd' = 0x8933, 'e' = 0x89d9, 'f' = 0x898d;, 'b':1 = 0xffff
ads few entries to micro dictionary named T1
then T1('a') would yeild to 0x8989
then T1('b') would eventually yeild to {0x2989, 0xffff }