template <class T, class U>
T min(T *array,U value)
    typename T::name *p; // ok for pointer declaration
    T::name * p;  // this is a multiply expression

Template Explicit Specialization

Overrides instantiation from the generic template definition

template <class T>
T max(T t1,T t2) { return (t1 >t2 ? t1:t2); }

const char *max<const char *> (const char *t1,const char *t2)
    return (strcmp(t1,t2)>0?t1:t2);
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License