possible implementations of casting in c++
<p>I have this snippet of the code in my <code>header</code>:</p>

<pre><code>class A {
private:
    int player;
public:
    A(int initPlayer = 0);
    A(const A&amp;);
    A&amp; operator=(const A&amp;);
    ~A();
    void foo() const;
friend int operator==(const A&amp; i, const A&amp; member) const;
};
</code></pre>

<h3>implementation of the operator==</h3>

<pre><code>int operator==(const A&amp; i, const A&amp; member) const{
    if(i.player == member.player){
        return  1;
    }
    return 0;

}
</code></pre>

<p>and I need casting for this part of my code:</p>

<p>i - is some int, which my function receives</p>

<p>A *pa1 = new A(a2);</p>

<pre><code>assert(i == *pa1);
</code></pre>

<p>I receive an error <code>non-member function</code>, How can I fix it? thanks in advance</p>
