next up previous
Next: How do I specify Up: What are templates? Previous: What are templates?

How do I specify a function template?

In a header (.h file) :
template <class T>
T       max(T   a,
            T   b)
{
  return (a < b)? b: a;
}



Alexis Angelidis (PhD) 2005-01-11