________________________________________
From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of hongleij@126.com
Sent: Thursday, February 01, 2007 9:00 AM
To: boost-users@lists.bo...
Subject: [Boost-users] [bind] how to get the type after bind
//my question is how to write the type ??? below to make it run .
#include
#include <iostream>
using boost::bind;
void print()
{
std::cout <<" print" << std::endl;
}
template <class T>
void func(T t)
{
std::cout <<"func1(T t) : " ;
t();
}
int main()
{
func(bind(&print)); //ok
bind ( &func<???>, bind(&print) ) ; //don't know how to write it
}
[Nat] This doesn't directly answer your question; the type produced by bind() is obscure. But would the following suit your need?
bind ( &func< boost::function >, bind(&print) ) ;