title: C++ overloading >> operator strange compile error
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class phonebook
  {
      string name;
      string prefix;
  public:
      phonebook(string &amp;name, string &amp;prefix)
      {
          this-&gt;name = name;
          this-&gt;prefix = prefix;
      }
  
      friend istream &amp;operator&gt;&gt;(istream &amp;in, phonebook &amp;book);
  };
  
  istream &amp;phonebook::operator&gt;&gt;(istream &amp;in, phonebook &amp;book)
  {
      in &gt;&gt; book.name &gt;&gt; book.prefix;
      return in;
  }
  
  int main()
  {
      return 0;
  }
  </code></pre>
  
  <p>When I try to compile this code using g++ 4.6.1:</p>
  
  <p>"main.cpp:20: error: ‘std::istream&amp; phonebook::operator>>(std::istream&amp;, phonebook&amp;)’ must take exactly one argument"</p>
  
  <p>PS: It was pretty dumb thing to ask... So obvious :S. Thank you though.</p>