11.12. Bitfield operator overloads
The BITFIELD_BOOST module provides utility macros for working with bitfield types including conversion between bitfield values and strings, and iteration over set bits.
All functions and symbols are in “bitfield_boost” module, use require to get access to it.
require daslib/bitfield_boost
11.12.1. Bitfield element access
- auto(TT)&[]&&=(b: auto(TT)&; i: int; v: bool ): auto
&& assignment for bitfield bit at index i
- Arguments:
b : auto(TT)&
i : int
v : bool
- auto(TT)&[]=(b: auto(TT)&; i: int; v: bool ): auto
set bitfield bit at index i to v
- Arguments:
b : auto(TT)&
i : int
v : bool
- auto(TT)&[]^^=(b: auto(TT)&; i: int; v: bool ): auto
toggle bitfield bit at index i if v is true
- Arguments:
b : auto(TT)&
i : int
v : bool
- auto(TT)&[]||=(b: auto(TT)&; i: int; v: bool ): auto
|| assignment for bitfield bit at index i
- Arguments:
b : auto(TT)&
i : int
v : bool
- auto[](b: auto; i: int ): bool
get bitfield bit at index i
- Arguments:
b : auto
i : int
11.12.2. Iteration
- each_bit(b: auto ): iterator<bool>
Iterates over each bit of a bitfield value, yielding true or false for each bit.
- Arguments:
b : auto