
27 Jan
2009
27 Jan
'09
11:10 a.m.
Hi, Steven Watanabe wrote:
Olaf Krzikalla wrote:
template<typename T> void foo(boost::function<T> func) { /*...*/ }
void bar() {}
void baz() { foo(boost::bind(&bar)); // error }
So how do I get the first line of baz to work? That is, is there a generic way to compute the boost::function type from the bind result?
There is not because the boost::function type is not unique.
Hmm, indeed. However wouldn't it be possible for the bind (member) function pointer overloads to return a "_bind_t_ex" type derived from _bind_t containing a function_type typedef? In my particular use case I will use bind with function pointers only. Best regards Olaf Krzikalla