title: Create a template that is a vector of a custom data type with multiple variables
body: <p>I must be able to use the command below where T can be any type, such as string.</p>
  
  <pre><code>Counter&lt;T&gt; counter;  
  </code></pre>
  
  <p>Counter should be able to hold multiple items so I have chosen to implement this as a vector. Each item must itself consist of a variable of type T (so a string if we continue the above example) and an int. I need to keep the solution as simple as possible as later on I will need to create functions that print out each item by descending int value amongst other tasks. I have had a go with the following code but 1) it doesn't work and 2) is there a better solution?</p>
  
  <pre><code>#include&lt;string&gt;
  #include&lt;cstdlib&gt;
  #include&lt;vector&gt;
  
  template&lt;class T&gt;
  class Record{
        T itemtype;
        int total;   
     public:
        int increment(T item);
        int count(T item);
        void printSummary();
  };
  
  
  class Counter{
        vector&lt;Record&gt; data;
  };
  
  int main(){
  
     Counter&lt;string&gt; counter;   
  
     return 0;
  }
  </code></pre>