title: C++ Operator () parenthesis overloading
body: <p>I recently asked a question about removing items from a vector. Well, the solution I got works, but I don't understand it - and I cannot find any documentation explaining it.</p>
  
  <pre><code>struct RemoveBlockedHost {
      RemoveBlockedHost(const std::string&amp; s): blockedHost(s) {}
  
      // right here, I can find no documentation on overloading the () operator
      bool operator () (HostEntry&amp; entry) { 
          return entry.getHost() == blockedHost || entry.getHost() == "www." + blockedHost;
      }
      const std::string&amp; blockedHost;
  };
  </code></pre>
  
  <p>to be used as:</p>
  
  <pre><code>hosts.erase(std::remove_if(hosts.begin(), hosts.end(), RemoveBlockedHost(blockedhost)), hosts.end());
  </code></pre>
  
  <p>I looked at std::remove_if's documentation, it says that it is possible to pass a class instead of a function only when the class overloads the () operator. No information whatsoever.</p>
  
  <p>Does anyone know of links to:
  <li></p>
  
  <ul>
  A book containing examples/explainations
  </ul>
  
  <ul>
  Or, a link to online documentation/tutorials
  </ul>
  
  <p></li></p>
  
  <p>Help with this would be appreciated. I dislike adding code to my software unless I understand it. I know it works, and I am familiar (somewhat) with operator overloading, but I don't know what the () operator is for.</p>