|
Boost Users : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-07-05 17:13:30
Pete Hodgson wrote:
> Peter Dimov wrote:
> ...
>>
>> not1 doesn't work well with boost::mem_fn applied to shared_ptr, but
>> you may try
>>
>> !boost::bind( &CEgg::IsHatched, _1 )
>>
>> instead.
>
> I tried the following:
>
> bool SomeEggsHaveHatched()
> {
> tEggsVector basketOfEggs;
>
> using boost::lambda::_1;
>
> tEggsVector::const_iterator it = std::find_if(
> basketOfEggs.begin(),
> basketOfEggs.end(),
> boost::bind( &CEgg::IsHatched, _1 ) );
>
> bool bSomeEggsHaveHatched = ( it != basketOfEggs.end() );
> return bSomeEggsHaveHatched;
> }
>
> but it won't compile, giving:
[...]
> Any clues as to what's going on here?
You are using boost::bind with boost::lambda::_1. Remove the using
boost::lambda::_1 line.
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