#enumerations — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #enumerations, aggregated by home.social.
-
C programmers, please help me figure out something:
Since C23, a C enum may be declared to have a specific underlying type, as in the following example. My question is, how can I find the underlying type of such an enum? (C++11's std::underlying_type trait gets me this information.) 🙏
```C
enum Size : char { small, medium, large );
```Code example in C++ and C: https://sigcpp.godbolt.org/z/eo7Tdqaeb
C enum: https://en.cppreference.com/w/c/language/enum
#question #c #programming #cpp #cplusplus #enumerations #enums
-
Moshi is one of the most popular #JSON parsing libraries on #Android, but for DRY-loving #AndroidDevs #Moshi has a weak point; #enumerations.
https://www.droidcon.com/2022/11/22/solving-the-moshi-enumeration-problem-using-generics/