Write a templated function countMatches that will take in a vector of the template type and a value of the same type. It should return the number of elements in the vector that match the given value.
Make a templated struct ItemCounter. An item counter should store item, a value of the templated type, and an int count, representing the number of that item. For instance, an ItemCounter<string> could store the string "apple" and the number 3.
Class ItemCounter has been declared. Write the constructor and all three methods for the class. A newly constructed ItemCounter should have a count of 0.