Boost logo

Boost Users :

Subject: [Boost-users] [boost] [asio] how to handle "boost::asio::placeholders::error" in "boost::function"?
From: ²ÜÑÇÎÄ (bobcyw_at_[hidden])
Date: 2010-04-26 12:09:17


Hi all,
I met a problem which can't be solved. Can any kind people help me?
The code looks like the below:

class transfor_data
{
public:
  void one_fun( const boost::system::error_code& e, connection conn )
  {
     ...
  }
  void another_fun()
  {
    {
      //compile error because of the placeholder
      boost::function<void(void)> fun =
boost::bind(&transfor_file_push::write_file, this,
boost::asio::placeholders::error, conn);
    }
    {
      //fine without placeholder
      boost::system::error_code e;
      boost::function<void(void)> fun =
boost::bind(&transfor_file_push::write_file, this, e, conn);
    }
  }
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net