I was reviewing the code of a junior colleague and encountered the following code.
void ActionGetId(boost::property_tree::ptree& callInfo);
void ActionPutId(boost::property_tree::ptree& callInfo);
void handler(int type, std::string data)
if(type == 0)
boost::bind copies the arguments you give it and stores the copies in the function object it returns. When the function is called, it will not act on a reference to the local variable (which no longer exists), but on a reference to the copy (which is still valid).
If you actually wanted
std::bind to use a reference to the variable (which you don't want here), you'd need to pass the variable to