title: How do you implement bubble sort on a vector of type class?
body: <pre><code>    do {
      swapped = false;
      for (int i = 0; i &lt; strs.size() - 1; i++) {
          if (strs[i].compareTo(strs[i + 1]) &gt; strs[i + 1].compareTo(strs[i])) {
              //swap(strs[i], strs[i + 1]);
              vector&lt;ASString&gt; temp;
              temp[0] = strs[i];
              strs[i] = strs[i + 1];
              strs[i + 1] = temp[0];
              swapped = true;
          }
      }
  } while (swapped == true);
  </code></pre>
  
  <p>I have this but it throws errors saying that there was a "Invalid parameter was padded to a function that considers invalid parameters fatal"</p>