The code above uses operator overloading. A function overloads an operator if the name of the function is operator followed by the operator being overloaded. It is just a normal function with a special name. http://www.cplusplus.com/doc/tutorial/templates/