 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Bob Hairgrove Guest
|
Posted: Sat Jun 26, 2004 8:22 am Post subject: Working with ranges of scalar values |
|
|
Hello,
Is there an STL class for working with contiguous ranges of things? I
can write one myself, but it would be nice if there were something
standard I could use -- don't like to re-invent the wheel. Boost
doesn't seem to have this, or have I overlooked something?
For example, I could implement a time range by storing either the
start and end times or the start time and number of seconds. Then I
would have member functions to calculate whether time A was contained
within the range, whether another range intersects it, etc.
TIA
--
Bob Hairgrove
[email]NoSpamPlease (AT) Home (DOT) com[/email]
|
|
| Back to top |
|
 |
Ivan Vecerina Guest
|
Posted: Tue Jun 29, 2004 9:25 am Post subject: Re: Working with ranges of scalar values |
|
|
"Bob Hairgrove" <wouldnt_you_like (AT) to_know (DOT) com> wrote
| Quote: | Is there an STL class for working with contiguous ranges of things? I
can write one myself, but it would be nice if there were something
standard I could use -- don't like to re-invent the wheel. Boost
doesn't seem to have this, or have I overlooked something?
|
Nothing in the STL. But you may have overlooked boost's interval library:
http://www.boost.org/libs/numeric/interval/doc/interval.htm
hth - Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- e-mail contact form
Brainbench MVP for C++ <> http://www.brainbench.com
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|