diff --git a/Functions/templates.cpp b/Functions/templates.cpp index 942a0f0..b778dd0 100644 --- a/Functions/templates.cpp +++ b/Functions/templates.cpp @@ -7,6 +7,7 @@ using namespace std; */ template T add(T &x, T &y) { // template to make a function to add numbers + // the T means type meaning that the values of the parameters can be any data-type // &x, &y are references to values that can be anything -> float, int, long, double etc T result = x + y; // makes a return variable from the T class part; can be anything // -> is now dynamically typed as it will find itself on runtime not beforehand