How do you use replace_if with a string?
<p>I'm trying to replace all whitespace characters in each line I'm parsing with a space.  The key line is:</p>

<pre><code>replace_if( theString.begin(), theString.end(), ::isspace, " ");
</code></pre>

<p>The (partial) error I can locate is:</p>

<blockquote>
  <p>In function ‘void std::replace_if(_ForwardIterator, _ForwardIterator, _Predicate, const _Tp&amp;) [with _ForwardIterator = __gnu_cxx::__normal_iterator, std::allocator > >, _Predicate = int (*)(int)throw (), _Tp = char [2]]’:
  instantiated from here</p>
</blockquote>

<p>What is the correct usage of replace_if in this situation?  I don't have access to Boost, so I'd prefer pure C++ suggestions please.  I've tried changing " " to string(" ").  I've tried making my own predicate (I am a novice, so don't rule this solution out entirely).  I'd prefer to use replace_if, but will accept an answer explaining why it is too complicated for this situation.  Thanks.</p>
