title: C++ trying to swap values in a vector
body: <p>This is my swap function:</p>
  
  <pre><code>template &lt;typename t&gt;
  void swap (t&amp; x, t&amp; y)
  {
      t temp = x;
      x = y;
      y = temp;
      return;
  }
  </code></pre>
  
  <p>And this is my function (on a side note v stores strings) call to swap values but whenever I try to call using values in a vector I get an error. I'm not sure what I'm doing wrong.</p>
  
  <pre><code>swap(v[position], v[nextposition]); //creates errors
  </code></pre>