I could use some help understanding the following in C++, particularly the difference between an operator and a function:
In C++ you can override what the symbols +, -, ==, etc. do when applied to class instances. By defining the "operator+" method in class A, you are telling the compiler what to do with code like:
A a, b, c;
c = a + b; // the + here actually calls a.operator+(b)
It's also a function or more precisely an instance method, in the sense that it's something that gets called.
EDIT: see also http://en.wikipedia.org/wiki/Operator_overloading and http://en.wikibooks.org/wiki/C++_Programming/Operators/Operator_Overloading