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:
<------------------------------SNIP--------------------------------------->
c:\WORK\4DCapture_Soln\thirdparty\boost\boost\bind\mem_fn_template.hpp(90)
: error C2664: 'R boost::_mfi::cmf0::call<const U>(const U &,const
T *) const' : cannot convert parameter 2 from 'const
boost::lambda::lambda_functor<T>' to 'const CEgg *'
with
[
R=bool,
T=CEgg,
U=boost::lambda::placeholder1_type
]
and
[
T=boost::lambda::lambda_functor_baseboost::lambda::addressof_action,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::tuples::null_type>>
]
No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
c:\WORK\4DCapture_Soln\thirdparty\boost\boost\bind.hpp(193) :
see reference to function template instantiation 'R
boost::_mfi::cmf0::operator
()>>(const U
&) const' being compiled
with
[
R=bool,
T=CEgg,
U=boost::lambda::placeholder1_type
]
c:\WORK\4DCapture_Soln\thirdparty\boost\boost\bind\bind_template.hpp(33)
: see reference to function template instantiation 'R
boost::_bi::list1<A1>::operator
()::result_type,F,boost::_bi::list1>(boost::_bi::type::result_type>,F,A &)'
being compiled
with
[
R=boost::_bi::bind_t,boost::_bi::list1boost::lambda::placeholder1_type::B1>>::result_type,
A1=boost::_bi::list_av_1boost::lambda::placeholder1_type::B1,
F=boost::_mfi::cmf0,
L=boost::_bi::list1boost::lambda::placeholder1_type::B1>,
T=CEgg,
A=boost::_bi::list1::value_type &>
]
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\algorithm(64) : see reference to function template
instantiation 'boost::_bi::bind_t::result_type
boost::_bi::bind_t::operator
()::value_type>(A1 &)' being compiled
with
[
R=bool,
F=boost::_mfi::cmf0,
L=boost::_bi::list1boost::lambda::placeholder1_type::B1>,
_Ty=boost::shared_ptr<CEgg>,
A1=std::allocator::value_type
]
c:\WORK\4DCapture_Soln\VideoCapture\PixelinkCaptureFacade.h(34)
: see reference to function template instantiation '_InIt std::f
ind_if::iterator,boost::_bi::bind_t>(_InIt,_InIt,_Pr)'
being compiled
with
[
_InIt=std::vector::iterator,
_Ty=boost::shared_ptr<CEgg>,
R=bool,
F=boost::_mfi::cmf0,
L=boost::_bi::list1boost::lambda::placeholder1_type::B1>,
_Pr=boost::_bi::bind_t,boost::_bi::list1boost::lambda::placeholder1_type::B1>>
]
<------------------------------SNIP--------------------------------------->
Any clues as to what's going on here?