boost::bind upgrading from 1.33.1 to 1.34.1 problem, part2

Hello,
Thanks Eric and Peter for the help with my previous question. Now I
have another question.
1.34.1 does not allow me to compile the following code (it was fine on
1.33.1):
struct CNode {void GetName(){}};
int main(int argc, char **argv){
typedef std::map

sj@sjcomp.com wrote:
Hello,
Thanks Eric and Peter for the help with my previous question. Now I have another question.
1.34.1 does not allow me to compile the following code (it was fine on 1.33.1): struct CNode {void GetName(){}}; int main(int argc, char **argv){ typedef std::map
TPNodes; TPNodes Children; std::for_each( Children.begin(), Children.end(), boost::bind( &CNode::GetName, // Problem here boost::bind(&TPNodes::value_type::second,_1))); return 0; } I get this error: error C2440: 'argument' : cannot convert from 'const CNode *__w64 ' to 'CNode *const ' c:\src\boost_1_34_1\boost\bind\mem_fn_template.hpp 35
The inner boost::bind returns a const reference to a CNode, and GetName
isn't const. Try
boost::bind
participants (2)
-
Peter Dimov
-
sj@sjcomp.com