bind forwarding problem

Hi all,
I'm running into a compile error using bind with visual c++ 7.1 and am hoping
some clever cookie here will be able to help. I've whittled the issue down to
a few simple functions (you'll have to trust that it makes sense in the original
context):
template <typename T_Param>
void foo(T_Param a_param)
{
}
template <typename T_Param>
void callFooWith(T_Param a_param)
{
boost::bind(&foo

"Trent Hill"
Hi all,
I'm running into a compile error using bind with visual c++ 7.1 and am hoping some clever cookie here will be able to help. I've whittled the issue down to a few simple functions (you'll have to trust that it makes sense in the original context):
template <typename T_Param> void foo(T_Param a_param) { }
template <typename T_Param> void callFooWith(T_Param a_param) { boost::bind(&foo
, a_param)(); // <- (1) ERROR HERE
try:
boost::bind(&foo
}
void bar(int) { }
int main(int a_argc, char *a_argv[]) { callFooWith(42); // <- (2) FINE callFooWith(boost::bind(&bar, 10)); // <- (3) FAILS return 0; }
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (2)
-
David Abrahams
-
Trent Hill