You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These have different semantics - nim enum are in particular a lot more strict than those of C - specially when they have holes or are used as flags, ie
The better way to map enum to nim is via constants and type EnumType = cint - this can be done with various amounts of machinery around it (distinct, overloaded and etc) - this raises awareness in code that uses the mapped API that they need to be careful around conversions to/from the enum and other pitfalls.
The text was updated successfully, but these errors were encountered:
These have different semantics - nim
enum
are in particular a lot more strict than those of C - specially when they have holes or are used as flags, ieThe better way to map enum to nim is via constants and
type EnumType = cint
- this can be done with various amounts of machinery around it (distinct
, overloadedand
etc) - this raises awareness in code that uses the mapped API that they need to be careful around conversions to/from the enum and other pitfalls.The text was updated successfully, but these errors were encountered: