Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
ChrisSD
6y ago
0 comments
Save
Share
I think that's a good thing. A C "enum" is just a shorthand for declaring an int alias and some constants. You can do that in Rust easily enough.
A Rust enum is an actual enumeration type, which C does not have. This is far more powerful.
0 comments
3 comments · 1 top-level
top
newest
oldest
brutt
6y ago
· 2 in thread
It's good thing, but it leads to error in code which must talk to C or network, where enum's are not cast in stone.
CameronNemo
6y ago
You really should not be casting data structures sent over the network directly to local data structures, unless you are using capnproto or another zero copy protocol that does that safely.
mlindner
6y ago
You can assign any value to a C enum, they literally are just integers.
j
/
k
navigate · click thread line to collapse