Reduce ranges of doubles in C++
<p>I've seen various approaches in other languages for how to do this, but it seems like a common enough problem that it seems like there should be a standard way to do this.</p>

<p>I want to collapse a list of float ranges to its smallest representation.</p>

<p>2.45-3.72
3.16-6.55
7.23-8.96
8.95-10.27</p>

<p>would become:</p>

<p>2.45-6.55
7.23-10.27</p>

<p>Is there a function or library in C++ somewhere that I can give my list to, and it will perform the reduction for me?  I could easily write my own, but why bother if it already exists?</p>
