title: Sort std::vector<int> but ignore a certain number
body: <p>I have an <code>std::vector&lt;int&gt;</code> of the size 10 and each entry is initially -1. This vector represents a leaderboard for my game (high scores), and -1 just means there is no score for that entry.</p>
  
  <pre><code>std::vector&lt;int&gt; myVector;
  myVector.resize(10, -1);
  </code></pre>
  
  <p>When the game is started, I want to load the high score from a file. I load each line (up to 10 lines), convert the value that is found to an <code>int</code> with <code>std::stoi</code>, and if the number is >0 I replace it with the -1 currently in the vector at the current position.</p>
  
  <p><strong>All this works. Now to the problem:</strong></p>
  
  <p>Since the values in the file aren't necessarily sorted, I want to sort <code>myVector</code> after I load all entries. I do this with</p>
  
  <pre><code>std::sort(myVector.begin(), myVector.end());
  </code></pre>
  
  <p>This sorts it in ascending order (lower score is better in my game).</p>
  
  <p>The problem is that, since the vector is initially filled with -1 and there aren't necessarily 10 entries saved in the high scores file, the vector might contain a few -1 in addition to the player's scores. </p>
  
  <p>That means when sorting the vector with the above code, all the -1 will appear before the player's scores.</p>
  
  <p><strong>My question is:</strong> How do I sort the vector (in ascending order), but all entries with -1 will be put at the end (since they don't represent a real score)?</p>