appropriate rust data structure for where C would use a bit field: a struct with bool fields? a bunch of u8 consts in a HashSet? a HashSet of some enum? a bit field? something else?
-
Show this thread
-
I want to treat the various flags of this structure as first-class values, so a struct with bool fields feels wrong
4 replies 0 retweets 1 likeShow this thread -
-
Replying to @sgrif
sure, but I'm also interested in what's a reasonably choice for this inside of std
1 reply 0 retweets 0 likes -
Replying to @mountain_ghosts
I think using the crate is the reasonable choice here personally. Not everything has a good option in std
1 reply 0 retweets 2 likes -
Replying to @sgrif
it's surprising to me that a systems language doesn't have a good baked-in idiom for a set of flags?
1 reply 0 retweets 0 likes
Replying to @mountain_ghosts
I mean, a struct with bools is fine for most folks. Needing 1 bit representation is a more niche case
3:32 AM - 4 Jun 2019
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.