Overloading operator + for inserting a node in a BinaryTree
<p>Those are my classes for the Binary Tree :</p>

<pre><code>class Node
{
    friend class BinaryTree;
    int value;
    Node *left, *right;
};

class BinaryTree
{
private :
    Node *first ;
public :
    void insert_node(int x);
    void delete_node(int x);
    void in_order_traversal();
    void print_leafs (Node *first);
    void print_leafs2 ();
    int get_height();
    BinaryTree();
    ~BinaryTree();

    // operator oveloading
};
</code></pre>

<p>I want to overload the + operator so I can insert one new element to the tree, the sequence should be like this :</p>

<pre><code>int x;
BinaryTree *bt;
x + bt; // or bt + x;
</code></pre>

<p>I already have a method that insert a node to the tree, and all I have to do is to call that method in the overloading operator + code. This is how I tried to do it :</p>

<pre><code>//inline declaration
friend BinaryTree&amp; operator + ( BinaryTree&amp; bt, const int x)
{
    bt.insert_node(x);
    return bt;
}
</code></pre>

<p>I don't know why but when I debug this code, the line </p>

<pre><code>bt + x;
</code></pre>

<p>is ignored by the compiler.</p>

<p>Any help will be appreciated :)</p>