Template Function Rose::BitOps::shiftLeftLsb

Template Function Rose::BitOps::shiftLeftLsb#

Function Documentation#

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

Left shift part of a value without affecting the rest.

The value src has its low-order w bits shifted n

places toward higher order. The

highest bits are discarded and the

n new lower order bits are either set or cleared depending on the value of 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.