Template Function Rose::BitOps::mask

Template Function Rose::BitOps::mask#

Function Documentation#

template<typename Unsigned>
inline Unsigned Rose::BitOps::mask(size_t least, size_t greatest)#

Generate a mask.

Returns a value where bits least through greatest (inclusive) are set and all other bits are cleared. The specified indexes must be valid for the type of x. In other words, greatest must be less than the number of bits in x and greatest must be greater than or equal to least.