
Hello,
I need some help using the boost::bind library. I have a map of objects
with a string as the key eg map

From: "Mark Snelling"
std::for_each(blocks.begin(), blocks.end(),
boost::bind(&Block::update,
boost::bind(&std::map

From: "Mark Snelling" [...]
Yes. You can use
std::for_each(mylist.begin(), mylist.end(), &deleter<Object>);
If this doesn't work, try
#include

Ok, I understand the following:
std::for_each(mylist.begin(),mylist.end(),boost::checked_deleter<Object>());
But when I try to use the boost::checked_deleter on the objects held in
a map using your solution to my first problem I don't seem to be able to
get it to compile:
template

From: "Mark Snelling"
Ok, I understand the following:
std::for_each(mylist.begin(),mylist.end(),boost::checked_deleter<Object>());
checked_delete is a function template (no trailing 'r'); checked_deleter is a class template. :-) Also, on MSVC 6/7 you need to specify a return type when binding general function objects: boost::bind<void>(boost::checked_deleter<Block>(), _2)
participants (2)
-
Mark Snelling
-
Peter Dimov