J
Jerry Fleming
As I am newbie to C++, I am confused by the overloading issues. Everyone
says that the four operators can only be overloaded with class member
functions instead of global (friend) functions: (), [], ->, =. I wonder
why there is such a restriction.
Some tutorials say that 'new' and 'delete' can only be overloaded with
static member functions, others say that all overloading function should
be non-static. Then what is the fact, and why?
I'd appreciate it very much if anyone can answer me or lead me to a
detail explanation.
says that the four operators can only be overloaded with class member
functions instead of global (friend) functions: (), [], ->, =. I wonder
why there is such a restriction.
Some tutorials say that 'new' and 'delete' can only be overloaded with
static member functions, others say that all overloading function should
be non-static. Then what is the fact, and why?
I'd appreciate it very much if anyone can answer me or lead me to a
detail explanation.