title: g++ string remove_if error
body: <p>Here's the code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;algorithm&gt;
  using namespace std;
  
  int main()
  {
      string word="";
      getline(cin,word);
      word.erase(remove_if(word.begin(), word.end(), isspace), word.end()); 
      word.erase(remove_if(word.begin(), word.end(), ispunct), word.end()); 
      word.erase(remove_if(word.begin(), word.end(), isdigit), word.end());
  }
  </code></pre>
  
  <p>When compiled in VS 2010, it works perfectly fine. Compiled with G++ it says:</p>
  
  <pre class="lang-none prettyprint-override"><code>hw4pr3.cpp: In function `int main()':
  hw4pr3.cpp:20: error: no matching function for call to `remove_if(__gnu_cxx::__normal_iterator&lt;char*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, __gnu_cxx::__normal_iterator&lt;char*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, &lt;unknown type&gt;)'
  hw4pr3.cpp:21: error: no matching function for call to `remove_if(__gnu_cxx::__normal_iterator&lt;char*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, __gnu_cxx::__normal_iterator&lt;char*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, &lt;unknown type&gt;)'
  hw4pr3.cpp:22: error: no matching function for call to `remove_if(__gnu_cxx::__normal_iterator&lt;char*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, __gnu_cxx::__normal_iterator&lt;char*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, &lt;unknown type&gt;)'
  </code></pre>