Overloaded '+' Operator Not Compiling
<p>I'm trying to understand the concept of operator overloading by writing some simple, silly tests. I thought this might be useful as this helps me understand C++ better. </p>

<p>Why does this example implementing a concatenation operator of <code>Animal</code> class and <code>std::string</code> not compile? G++ gives me the following error:</p>

<blockquote>
  <p>extra qualification 'Animal::' on member 'operator+' [-fpermissive]</p>
</blockquote>

<p>This is the code:</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

class Animal {

public:
    string _type;
    string _name;
    string _sound;


    Animal &amp; Animal::operator+(const string &amp; o);
};


Animal &amp; Animal::operator+(const string &amp; o) {
    cout &lt;&lt; "plus operator \n";
    this-&gt;_name=o;
    return *this;
}


int main( int argc, char ** argv ) {
    Animal a;

    a+"hhh";
    cout&lt;&lt;a._name;
    return 0;
}
</code></pre>
