Template Function Rose::BitOps::shiftRightLsb

Template Function Rose::BitOps::shiftRightLsb#

Function Documentation#

template<typename Unsigned>
inline Unsigned Rose::BitOps::shiftRightLsb(Unsigned src, size_t w, size_t n, bool b = false)#

Right shift part of a value without affecting the rest.

The value src has its low-order w bits shifted right toward lower order. The n lowest bits are discarded and the n new higher order bits are either set or cleared depending on b. If n is greater than or equal to w then all affected bits are set or cleared, depending on b. The bits not in the affected range are not affected and are returned.