View source code Display the source code in std/bitmanip.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

Struct std.bitmanip.BitArray

An array of bits.

Constructors

Name Description
this Set this BitArray to the contents of ba.
this Map the BitArray onto v, with numbits being the number of bits in the array. Does not copy the data. v.length must be a multiple of size_t.sizeof. If there are unmapped bits in the final mapped word then these will be set to 0.

Properties

Name Type Description
dim [get] ulong Gets the amount of native words backing this BitArray.
dup [get] BitArray Duplicates the BitArray and its contents.
length [set] ulong Sets the amount of bits in the BitArray. Warning: increasing length may overwrite bits in final word up to the next word boundary. i.e. D dynamic array extension semantics are not followed.
length [get] ulong Gets the amount of bits in the BitArray.
reverse [get] BitArray Reverses the bits of the BitArray.
sort [get] BitArray Sorts the BitArray's elements.

Methods

Name Description
bitsSet Return a lazy range of the indices of set bits.
init Will be deprecated in 2.068. Please use the constructor instead.
opApply Support for foreach loops for BitArray.
opBinary Support for binary bitwise operators for BitArray.
opCast Convert to size_t[].
opCast Convert to void[].
opCat Support for binary operator ~ for BitArray.
opCatAssign Support for operator ~= for BitArray. Warning: This will overwrite a bit in the final word of the current underlying data regardless of whether it is shared between BitArray objects. i.e. D dynamic array concatenation semantics are not followed
opCat_r Support for binary operator ~ for BitArray.
opCmp Supports comparison operators for BitArray.
opCom Support for unary operator ~ for BitArray.
opEquals Support for operators == and != for BitArray.
opIndex Gets the i'th bit in the BitArray.
opIndexAssign Sets the i'th bit in the BitArray.
opOpAssign Support for operator op= for BitArray.
opOpAssign Operator <<= support.
opOpAssign Operator >>= support.
toHash Support for hashing for BitArray.
toString Return a string representation of this BitArray.

Authors

Walter Bright, Andrei Alexandrescu, Jonathan M Davis, Alex Rønne Petersen, Damian Ziemba Amaury SECHET

License

Boost License 1.0.

Comments