
On Monday, 2. April 2012 13:12:30 Thomas Heller wrote:
The problem is that boost::posix_time::time_period::contains is overloaded. Thus the compiler can not decide which function address you mean. The solution I usually go with is the following:
bool (boost::posix_time::time_period::*f)(boost::posix_time::time_period const &) const = &boost::posix_time::time_period::contains;
or:
bool (boost::posix_time::time_period::*f)(boost::posix_time::ptime const &) const = &boost::posix_time::time_period::contains;
Depending on what type time_ actually is ...
and then continue with:
LightningQueue::const_iterator l = std::find_if( m_lightnings.begin(), m_lightnings.end(), bind(f, ll::bind(&LightningSlice::timeslice, ll::_1 ), time_ ) );
Thanks, this works now. But I think I need a lot of comments for the next code reviewer to understand it. Greetings, Sven