Is there a more efficient way to sort two numbers?
<p>I want <code>dLower</code> and <code>dHigher</code> to have the lower and higher of two double values, respectively - i.e. to sort them if they are the wrong way around. The most immediate answer, it seems is:</p>

<pre><code>void ascending(double&amp; dFirst, double&amp; dSecond)
{
    if(dFirst &gt; dSecond)
        swap(dFirst,dSecond);
}

ascending(dFoo, dBar);
</code></pre>

<p>But it seems like such an obvious thing to do I wondered if I'm just not using the right terminology to find a standard routine. </p>

<p>Also, how would you make that generic?</p>
