title: Specify a class member function as a friend of another class?
body: <p>According to the C++ Primer book, the author mentioned that we can specify a class member function as a friend of another class, instead of the entire class (page 634).</p>
  <p>Then, I tested this code:</p>
  <pre><code>class A
  {
  public:
      friend void B::fB(A&amp; a);
      void fA(){}
  };
  class B
  {
  public:
      void fB(A&amp; a){};
      void fB2(A&amp; a){};
  };
  </code></pre>
  <p>I just wanted the <code>fB()</code> to be friend of <code>class A</code>, not the entire <code>class B</code>. But the above code produced an error: <code>'B' : is not a class or namespace name</code>.
  (I am using Visual C++ 2005)</p>