$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Seweryn Habdank-Wojewódzki (habdank_at_[hidden])
Date: 2007-03-26 14:31:05
Hi!
I have small piece of code and I do not know why it is not compiling -
proper instantiation of function is not created.
It means, why boost::function can not deduct types (code below).
The problem is when type U is void. Can any one help me with it?
Regards.
template < typename T, typename U >
void test ( boost::function<T(U)> & f )
{
f();
}
int f3()
{
std::cout << "f3(void)" << std::endl;
return 3;
}
void f4()
{
std::cout << "f4(void)" << std::endl;
return;// 4;
}
int main()
{
boost::function<int (void)> h = &f3;
boost::function<void (void)> i = &f4;
test (h);
test (i);
}
-- |\/\/| Seweryn Habdank-Wojewódzki \/\/