Boost logo

Boost Users :

Subject: [Boost-users] boost::array and lower_bound
From: Hicham Mouline (hicham_at_[hidden])
Date: 2009-03-26 05:29:55


Hello,
I maintain a boost::array< pair< time, value > > B,
sorted by time, where I defined operator< for pair<time, value>

I wish to get a given entry from the array for a given time y.

If y matches any entry, value is returned, if y is between 2 entries, an
interpolated value is returned.

std::lower_bound( &B[0], &B[supSize], ... ) //this doesn't work

I suppose for this I need to define some other related iterator to pass to
lower_bound,
not boost::array< pair< time, value > >::const_iterator.

I suppose this is what "Iterator adaptors" are about ?
I have seen the term "views" as well, is this related?

Regards,


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net