Function to copy characters from one buffer to another given the maximum size
The function copy_max() is mis-named, No one maintaining this code would know from the name of the function that the from string is being shortened by the from.erase(from.begin(), prev_pos). Copy does not imply destruction of the source, move might be more appropriate.

You may also want to consider the Single Responsibility Principle and break copy_max() into multiple functions. I see at least 2 functions there. This loop is complex enough to be it's own function and can be called from
copy_max()

    while(pos != from.end() &amp;&amp; index &lt;= limit)
    {
        prev_pos = pos;
        pos = std::find(pos + 1, from.end(), delim);
        index = std::distance(from.begin(), pos);
    }


Doing so makes the logic of copy_max() clearer.

I'm fairly sure that you can calculate index only once. I'm not sure why it's being calculated in 3 different places in copy_max().

The title is miss leading as well, since this will copy more than just characters.