fill from lowest zero bit | set all 1s after the last 0 to 0 |
isolate lowest zero bit | set all bits other than the lowest cleared bit to 1 |
isloate lowest zero bit and complement | replace the lowest zero bit with 1 with all other bits set to 0 |
mask from lowest zero bit | X |
set lowest zero bit | set the lowest zero bit to 1 |
fill from lowest one bit | set all zero bits after the last 1 to 1 |
isloate lowest one bit and complement | set all bits to 1 except for the lowest 1 bit |
inverse mask from trailing ones | X |
See Wikipedia.
unsigned int to_be_done( unsigned int value );
template <typename T> T to_be_done( T value );