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 to the contents of .
|
this
|
Map the onto , with 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 .
|
dup
[get]
|
BitArray |
Duplicates the and its contents.
|
length
[set]
|
ulong |
Sets the amount of bits in the .
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 .
|
reverse
[get]
|
BitArray |
Reverses the bits of the .
|
sort
[get]
|
BitArray |
Sorts the '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 .
|
opBinary
|
Support for binary bitwise operators for .
|
opCast
|
Convert to size_t[] .
|
opCast
|
Convert to void[] .
|
opCat
|
Support for binary operator ~ for .
|
opCatAssign
|
Support for operator ~= for .
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 .
|
opCmp
|
Supports comparison operators for .
|
opCom
|
Support for unary operator ~ for .
|
opEquals
|
Support for operators == and != for .
|
opIndex
|
Gets the 'th bit in the .
|
opIndexAssign
|
Sets the 'th bit in the .
|
opOpAssign
|
Support for operator op= for .
|
opOpAssign
|
Operator <<= support.
|
opOpAssign
|
Operator >>= support.
|
toHash
|
Support for hashing for .
|
toString
|
Return a string representation of this BitArray .
|
Authors
Walter Bright, Andrei Alexandrescu, Jonathan M Davis, Alex Rønne Petersen, Damian Ziemba Amaury SECHET