error C2027: use of undefined type 'T'
//** Maximum value in a vector **// template <typename T> T max(vector<T>& input,int* index_of_maximum = NULL) { vector<T>::iterator i = input.begin(); T maximum = *i; int index = 0; for(i++; i!=input.end(); i++){ if(*i>maximum) maximum = *i; index++; } if(index_of_maximum) *index_of_maximum = index-1; return maximum; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)