Class method loses private modifier after cast
<p>I need to set callback, but I dont want to make it global function, I dont need it public aswell, so I've made it private. Wondering, is it the right way to go.</p>

<pre><code>class A // button object from window library. I wont change this class
{
public:
    typedef void (*fptr)();
    void set(fptr p)
    {
        p(); // here I call private static of B
    };
};
class B // my own class
{
private:
    static void prfn() {};
public:
    B()
    {
        A a;
        a.set(prfn);
    };
};
int main(){B b;}
</code></pre>
