Boost logo

Boost Users :

Subject: Re: [Boost-users] Lambda and placeholders
From: Sven Bauhan (sven.bauhan_at_[hidden])
Date: 2012-04-02 11:46:09


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


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