programminga general overview int mainvector )vector )vector )vector )/additional code to fill in the vectors not shown cout <findmaxv <endlcout <findmaxv <endlcout <findmaxv <endlcout <findmaxv <endl/okcomparable int /okcomparable double /okcomparable string /illegaloperatorundefined return figure using findmax function template ambiguitiesand the rules are quite complex note that if there is nontemplate and template and both matchthen the nontemplate gets priority also note that if there are two equally close approximate matchesthen the code is illegal and the compiler will declare an ambiguity class templates in the simplest versiona class template works much like function template figure shows the memorycell template memorycell is like the intcell classbut works for any type /* class for simulating memory cell *template class memorycell publicexplicit memorycellconst object initialvalue objectstoredvalueinitialvalue const object readconst return storedvaluevoid writeconst object storedvalue xprivateobject storedvalue}figure memorycell class template without separation