Sujet : Re: C23 enums
De : thiago.adams (at) *nospam* gmail.com (Thiago Adams)
Groupes : comp.lang.cDate : 18. Jun 2024, 12:09:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v4rpsp$1alv6$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 18/06/2024 04:00, Lawrence D'Oliveiro wrote:
On Sat, 15 Jun 2024 06:04:58 -0300, Thiago Adams wrote:
I realized we can have "private" enums in C23, because they are
completed types. Values of E does not need to be at header file.
>
enum E : int;
>
struct X{
enum E e;
};
What would be the point of this?
This creates a kind of encapsulation. Including the header file will not include the values and consequently the usage of e is discouraged.