8.13 — Function templates – Learn C++

PHOTO EMBED

Wed Mar 16 2022 19:24:38 GMT+0000 (Coordinated Universal Time)

Saved by @pham24n #c++

template <typename T> // this is the template parameter declaration
T max(T x, T y) // this is the function template definition for max<T>
{
    return (x > y) ? x : y;
}
content_copyCOPY

https://www.learncpp.com/cpp-tutorial/function-templates/