Tagged: operator overloading


Function Templates and Operator Overloading

std::cout << “Hello Readers!” << std::endl;In this blog post I’m going to show you a short example of a function template by using a struct and operator overloading. Function templates are blueprints of your function, it plugging-in the type that’s needed. Compiler generates the functions in compile time. The trick is if you use an operator, your type must support it! Otherwise, you have to overload that operator. Right now...