Sujet : Re: C23 enums
De : thiago.adams (at) *nospam* gmail.com (Thiago Adams)
Groupes : comp.lang.cDate : 19. Jun 2024, 13:38:24
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v4ujg0$1vgo2$1@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 19/06/2024 04:24, Lawrence D'Oliveiro wrote:
On Tue, 18 Jun 2024 08:09:13 -0300, Thiago Adams wrote:
This creates a kind of encapsulation.
Why not just use “int” or “unsigned int”? Why does the caller even need to
know it’s an enum?
The advantage will be the type check at the implementation file (some compiler have extra type check for enuns) and clarity about the possible values accepted.