$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] boost::bind can't bind bind_t type right?
From: Igor R (boost.lists_at_[hidden])
Date: 2011-03-15 10:17:25
#include <iostream>
#include <boost/bind.hpp>
#include <boost/bind/protect.hpp>
#include <boost/function.hpp>
class test1
{
public:
template<typename S>
double handle(S s)
{
s(1);
std::cout<<"test1\n";
return 1;
}
template<typename F>
void handle1(F f){
boost::bind(&test1::handle<boost::_bi::protected_bind_t<F>
>,this, protect(f))();
}
};
class test2
{
public:
double handle(int i)
{
std::cout<<"test2\n";
return i;
}
};
int main()
{
test2 t2;
test1 t1;
t1.handle1(boost::bind(&test2::handle,t2,_1));
return 0;
}