[#ConvertBits]
= ConvertBits
:mrdocs:

Convert from one power&hyphen;of&hyphen;2 number base to another&period;

== Synopsis

Declared in `&lt;util&sol;strencodings&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    int frombits,
    int tobits,
    bool pad,
    typename O,
    typename It,
    typename I = std::identity&gt;
bool
ConvertBits(
    O outfn,
    It it,
    It end,
    I infn = &lcub;&rcub;);
----

== Return Value

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *outfn*
| Callback invoked with each produced output value&period;
| *it*
| Iterator to the first input value&period;
| *end*
| Iterator past the last input value&period;
| *infn*
| Callback mapping each input element to a non&hyphen;negative integer value&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
