The sample code is like this:

#include <boost/bind.hpp>
#include <boost/system/error_code.hpp>
#include <string>

template<typename Handler1, typename Handler2>
void two_handler_test_func(const char* p1, const char* p2, Handler1 handler1, Handler2 handler2)
{
handler1(boost::system::error_code());
handler2(boost::system::error_code());
}

class MyTestClass
{
public:
template<typename Handler>
void test_func(const std::string& p1, const std::string& p2, Handler handler)
{
two_handler_test_func(p1.c_str(), p2.c_str(),
boost::bind(&MyTestClass::handle_test_func1<Handler>, this, _1, handler),
boost::bind(&MyTestClass::handle_test_func2, this, _1, 2));
}

private:
template<typename Handler>
void handle_test_func1(const boost::system::error_code& ec, Handler handler)
{
handler(ec);
}

void handle_test_func2(const boost::system::error_code& ec, int b)
{}

};

void command_listen_finished(const boost::system::error_code& ec, int i)
{}

void command_listen_finished2(const boost::system::error_code& ec)
{}

class TestCallback
{
public:
TestCallback(int i)
:m_i(i)
{}

void operator()(const boost::system::error_code& ec)
{}
private:
int m_i;
};

int main()
{
MyTestClass testClass;
testClass.test_func("abc", "def", boost::bind(command_listen_finished, _1, 1));
//testClass.test_func("abc", "def", command_listen_finished2);
//testClass.test_func("abc", "def", TestCallback(1));
return 0;
}



The last three "testClass.test_func" call.
The first one can not pass the compile, but the second and thrid can.
I thought the first one bind is build a same functor as the third one, but it just can not pass compile.
I use boost 1.4.3

The compile I use is VC9, the detail version is below:
Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1
Installed Edition: Enterprise
Microsoft Visual C++ 2008 91899-153-0000007-60183

Thanks for help...