what is the fastest way of sorting a vector?
<p>I want to sort the "mystruct" by the distance variable, what is the fastest way of doing this?</p>

<pre><code>struct MyStruct {
   int scale;
   bool pass;
   float distance;
};
vector&lt;MyStruct&gt; mystruct;
...
sort (mystruct.begin(), mystruct.begin() + mystruct.size());
//this doesn't work since is trying to sort by "MyStruct" and not by a number
</code></pre>

<p>if I had a</p>

<pre><code>vector&lt;float&gt; myfloat;
...
sort (myfloat.begin(), myfloat.begin() + myfloat.size());
</code></pre>

<p>then will work perfectly.</p>
