Skip to content

IntegerOps::msb_set

Optionally returns the zero‐origin position of the most significant set bit. Returns nothing if no bits are set.

Synopsis

Declared in <src/Rose/StringUtility/IntegerOps.h>

template<typename T>
std::optional<size_t>
msb_set(T val);

Return Value

Index of most significant set bit, or empty.

Parameters

Name

Description

val

Input value.

Created with MrDocs