
--- Peter Dimov
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).
I can't add this to my code:
using namespace boost::lambda::bind;
It said :
g++ -O0 -g3 -Wall -c -fmessage-length=0
-oBlockDataUtils.o ../BlockDataUtils.cpp
../BlockDataUtils.cpp:15: error: expected
namespace-name before â;â token
../BlockDataUtils.cpp:15: error: â<type error>â is
not a namespace
And I still can't get my code to compile:
code:
int count = count_if (bdl.begin(), bdl.end(), bind(
&BlockData::isContainer, _1));
error:
g++ -O0 -g3 -Wall -c -fmessage-length=0
-oBlockDataUtils.o ../BlockDataUtils.cpp
../BlockDataUtils.cpp: In function âbool
hasContainerBlock(BlockDataList&)â:
../BlockDataUtils.cpp:95: error: no matching function
for call to âbind(<unknown type>, const
boost::lambda::lambda_functor
&)â make: *** [BlockDataUtils.o] Error 1
Any help is appreicate.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com