Deutsch English Français Italiano |
<vapmhq$3ullf$3@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Thiago Adams <thiago.adams@gmail.com> Newsgroups: comp.lang.c Subject: Re: enum sets Date: Thu, 29 Aug 2024 08:37:30 -0300 Organization: A noiseless patient Spider Lines: 44 Message-ID: <vapmhq$3ullf$3@dont-email.me> References: <vaoclb$3lfbf$1@dont-email.me> <21d096d342279f8bcbb47f264401d3848c4e00aa@i2pn2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 29 Aug 2024 13:37:31 +0200 (CEST) Injection-Info: dont-email.me; posting-host="f80b8b85f3cf443035f3bd640f6489b4"; logging-data="4150959"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aXOZ2QqjsCt5TU/tghM0ZL1SQPIacuqM=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:omYfMXm6kk42MTzSQylVCJHbMqM= In-Reply-To: <21d096d342279f8bcbb47f264401d3848c4e00aa@i2pn2.org> Content-Language: en-US Bytes: 2017 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 } }