Skip to content

Rose::BitOps::convert

Extend or truncate a value.

Synopsis

Declared in <src/Rose/BitOps.h>

template<
    typename UnsignedTarget,
    typename UnsignedSource>
UnsignedTarget
convert(
    UnsignedSource x,
    bool b = false);

Description

When the destination type is smaller than the source type, the most significant bits of the source value are discarded, otherwise the most significant bits of the destination type are set to b.

Return Value

Converted value.

Parameters

Name

Description

x

Input value.

b

Fill bit value when extending.

Created with MrDocs