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
I'm currently trying to implement a few bit-parallel algorithms in Rust that I planned to use the BitVec type for. I frequently have to use bit-wise operations (|,&,^,<<,>>) on the bit vectors and was a bit disappointed that only &, | and ^ are supported, and that only as in-place operations via union, difference and intersection. Shifting is currently not supported at all.
Is there a specific reason why the bit-wise traits for these operations from std::ops (BitAnd, Shl, etc) are not implemented for this type? If not, would there be interest in a PR that implements them?
The text was updated successfully, but these errors were encountered:
I'm not fundamentally opposed, but they seem like terribly expensive things to do by-value. What's your use-case look like? Are you sure you want to be making that many allocations?
I second the need of shift operations. A use case would be : if a bitvec represents possible moves on a board, >> 1 would represent the set of adjacent moves.
About the allocation, I think implementing the assign operations shl_assign, shr_assign do not incur additional allocations. Would it be better to implement shift that way ?
I'm currently trying to implement a few bit-parallel algorithms in Rust that I planned to use the
BitVec
type for. I frequently have to use bit-wise operations (|
,&
,^
,<<
,>>
) on the bit vectors and was a bit disappointed that only&
,|
and^
are supported, and that only as in-place operations viaunion
,difference
andintersection
. Shifting is currently not supported at all.Is there a specific reason why the bit-wise traits for these operations from
std::ops
(BitAnd
,Shl
, etc) are not implemented for this type? If not, would there be interest in a PR that implements them?The text was updated successfully, but these errors were encountered: