
yinglcs2@yahoo.com wrote:
int count = count_if (bdl.begin(), bdl.end(), bind( &BlockData::isContainer, _1) );
This looks like it should work, assuming bool BlockData::isContainer() const;
But this code does not copmile,I get this error: g++ -O0 -g3 -Wall -c -fmessage-length=0 -oBlockDataUtils.o ../BlockDataUtils.cpp ../BlockDataUtils.cpp: In function â?~bool hasContainerBlock(BlockDataList&)â?T: ../BlockDataUtils.cpp:95: error: no matching function for call to â?~bind(<unknown type>, const boost::lambda::lambda_functor
&)â?T
Since you are using the _1 placeholder from the Lambda library, you need to use boost::lambda::bind as well. Currently boost::bind and Lambda do not recognize each other's placeholders (and don't interoperate in general).