Skip to content

unlikely

The unlikely is a keyword used as a branch prediction hint to compilers, indicating that a branch is unlikely to be taken.

Syntax

if (condition) unlikely
{
}
switch (enumerate)
{
unlikely case Enum::_RareValue:
    break;
}

Example Code

void process(int32* p)
{
    if (p is null) unlikely
    {
        return;
    }

    // normal processing path
}