C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Working with ranges of scalar values

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Bob Hairgrove
Guest





PostPosted: Sat Jun 26, 2004 8:22 am    Post subject: Working with ranges of scalar values Reply with quote



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





PostPosted: Tue Jun 29, 2004 9:25 am    Post subject: Re: Working with ranges of scalar values Reply with quote



"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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.