Exercise 1: Finding Max in an Array
Generalize the function for finding the maximum element in an array using templates.
We'll cover the following...
We'll cover the following...
Problem statement
Define a template class type function array_max that will generalize the function such that it finds the maximum value for both int and double type array input values. This function takes the array and the number of elements in the array as parameters.
Note: Remove both the
intanddoubletypeindex_of_smallestfunctions and then write the code for the template class typeindex_of_smallestfunction there.