Skip to content

Rose::BitOps::select

Combine two values based on a bit mask.

Synopsis

Declared in <src/Rose/BitOps.h>

template<typename Unsigned>
Unsigned
select(
    Unsigned cond,
    Unsigned a,
    Unsigned b);

Description

The return value has bits from a and b depending on the mask cond. If the mask bit i is set, then the return value bit i comes from a, otherwise it comes from b.

Return Value

Combined value.

Parameters

Name

Description

cond

Mask selecting between a and b.

a

Value used when mask bit is 1.

b

Value used when mask bit is 0.

Created with MrDocs