
----- Mail original -----
De: "Sven Bauhan"
À: boost-users@lists.boost.org Envoyé: Lundi 2 Avril 2012 09:52:38 Objet: Re: [Boost-users] Lambda and placeholders namespace ll = boost::lambda; ... = std::find_if(..., ll::bind(&Timeslice::contains, ll::bind(&LightningSlice::timeslice, ll::_1), time_));
Yes, it's ugly. Unfortunately, you can't really improve on it.
Sebastian _______________________________________________
Thanks,
I tried this suggestion:
#include
namespace ll = boost::lambda; LightningQueue::const_iterator l = std::find_if( m_lightnings.begin(), m_lightnings.end(), bind( &boost::posix_time::time_period::contains, ll::bind( &LightningSlice::timeslice, ll::_1 ), time_ ) );
But then I got this error message:
"error: no matching function for call to 'bind'" Your first "bind" is not "ll::"-prefixed. Regards, Ivan
../LightningIndex.cpp: In member function 'weather::LightningSlice weather::LightningIndex::getLightningSlice(boost::posix_time::ptime)': ../LightningIndex.cpp:40: error: no matching function for call to 'bind(<unresolved overloaded function type>, const boost::lambda::lambda_functor
, boost::tuples::tuple
>, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >, boost::posix_time::ptime&)' This is even more confusion than the first error message.
Greetings, Sven _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users