Convert from one power-of-2 number base to another.
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 = {});
true on success, false if an input value is invalid or leftover bits cannot be padded.
| 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. |