Here's the code:
Code:
                     if (x + phrase.size() >= max_width || y >= max_height)
                     {
                       string::size_type phrase_size = phrase.size();
                       string::size_type over_flow = (max_width + x) - phrase_size;
                       phrase.erase(over_flow);
                       x = max_width;
                     }
                     else
                     {
                      cout << phrase;
                      x += phrase.size();
                     }
The error is:
Line: 42
error: passing `const std::string' as `this' argument of `std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::erase(typename _Alloc::size_type, typename _Alloc::size_type) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' discards qualifiers|
||=== Build finished: 1 errors, 0 warnings ===|

I get from this that I'm not passing an argument correctly, or something, but I'm unsure of why. How can I fix it? It's supposed to take:

Code:
-----------------------
|                          |
|                          |
|                  Some Text
-----------------------

into

-----------------------
|                          |
|                          |
|                  Some
-----------------------

eventually I want it to be

-----------------------
|                          |
|                          |
|                   Som|
-----------------------