
5 Jul
2006
5 Jul
'06
9:13 p.m.
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.