I\'m trying to understand operators in C++ more carefully.
I know that operators in C++ are basically just functions. What I don\'t get is, what does the function lo
For basic types like int
, float
, double
; the operators are already overloaded/pre-defined, so nothing special can be done for that. And,
int z = x + y;
is the only way to express/call it.
For interpretation purpose, actually both the statements,
int z = operator+(x,y);
int z = x.operator+(y);
are true (had it been overloadable).