.net - When should I use a BitVector32? -
i working on project @ moment need show 1 month days still available. there function calculates days available. colleagues said:"oh know, should return bitvector32
. that's efficient when working list of booleans." have used list<bool>
or that. bitvector32
seems me low level stuff when working bits.
so, question is. should use bitvector32
whenever need list of booleans less 32 items or should use low level stuff?
using list extensible other time periods. want show 2 month @ once. oh that's bigger 32. need change return type , everywhere it's used. great! , bitvector32
doesn't implement ienumerable<t>
.
and unless it's in tight loop readability , maintainability top efficiency. , overhead of list allocation isn't big, unless million times per second.
so agree you should use bitvector32 low level code.
Comments
Post a Comment