Skip to content

Rose::BitOps::shiftLeft

Left shift a value.

Synopsis

Declared in <src/Rose/BitOps.h>

template<typename Unsigned>
Unsigned
shiftLeft(
    Unsigned src,
    size_t n,
    bool b = false);

Description

The value src has its bits shifted n places toward higher order. The highest order bits are discarded and the n new low‐order bits are either set or cleared depending on the value of b. If n is greater than or equal to the number of bits in src then the return value has either all bits set or all bits cleared depending on b.

Return Value

Shifted value.

Parameters

Name

Description

src

Input value.

n

Shift count.

b

Fill bit value.

Created with MrDocs