Template Function Rose::BitOps::replicate#
Defined in File BitOps.h
Function Documentation#
-
template<typename Unsigned>
inline Unsigned Rose::BitOps::replicate(Unsigned src, size_t n)# Replicate low-order bits to fill return value.
The
nlow-order bits ofsrcare repeated as a group as many times as necessary to fill the entire return value. For instance, ifsrccontains 0xabcdef andnis 8 and the return type is a 32-bit unsigned integer, then the return value will be 0xefefefef. If the width of the return value is not an integer multiple ofn, then the high order bits of the return value will contain only some of the lowest order bits of thesrc. The value ofncannot be zero.