Having a design in the form of:
struct Node
{
Node():left_(nullptr), right_(nullptr)
{ }
int id_;
Node* left_;
Node* right_;
};
I would like to include the syntax:
Node parent;
Node child;
parent.right_ = child;
So for this I need:
Node& operator=(Node* left, Node right);
but I get msg that operator = should be a member of fnc; Is there a way around this limitation?
source
share