title: Removing non alphabetic character from string c++
body: <p>This is driving me to the wall.</p>
  
  <pre><code>template&lt;typename t&gt;
  void Tree&lt;t&gt;::readFromFile(string filename)
  {
  //
      str.erase( remove_if(str.begin(), str.end(), aZCheck), str.end());
  //
  }
  template&lt;typename t&gt;
  bool Tree&lt;t&gt;::aZCheck(char c)
  {
      if (isalpha(c))
          return false;
      else return true;
  
  }
  </code></pre>
  
  <p>Gives an error :<code>cannot convert 'Tree&lt;t&gt;::aZCheck&lt;std::basic_string&lt;char&gt; &gt;' from type 'bool (Tree&lt;std::basic_string&lt;char&gt; &gt;::)(char)' to type 'bool (Tree&lt;std::basic_string&lt;char&gt; &gt;::*)(char)'|</code></p>
  
  <p>Worked fine until I moved both methods into the class.</p>
  
  <pre><code>str.erase( remove_if(str.begin(), str.end(), isalpha), str.end());
  </code></pre>
  
  <p>Doesnt work without using static cast and I am using cctype or ctype.h libraries, static cast is for c++ locale library which I am not using.</p>
  
  <p>I can get it to work using static cast, but then I cant seem to make it negative <code>!isalpha</code>.
  As I need to delete non alphabetic characters and as it is , it will delete alphabetic ones. Forcing me into creating separate method, which I mentioned as my first issue. And it worked until I moved method into class.</p>
  
  <p>Chances are I am missing something completely obvious, but I just cant figure it out...</p>