Convert from one power‐of‐2 number base to another.

Synopsis

Declared in <util/strencodings.h>

template<
    int frombits,
    int tobits,
    bool pad,
    typename O,
    typename It,
    typename I = std::identity>
bool
ConvertBits(
    O outfn,
    It it,
    It end,
    I infn = {});

Return Value

true on success, false if an input value is invalid or leftover bits cannot be padded.

Parameters

Name

Description

outfn

Callback invoked with each produced output value.

it

Iterator to the first input value.

end

Iterator past the last input value.

infn

Callback mapping each input element to a non‐negative integer value.

Created with MrDocs