I came across this code the other day:
template< class T >
T findMax(const T const * data,
const size_t const numItems) {
// Obtain the minimum value for type T
T largest =
std::numeric_limits< T >::min();
for(unsigned int i=0; i<numItems; ++i)
if (data[i] > largest)
largest = data[i];
return largest;
}
Why do the parameters each contain two const
s?