23 Aug
2007
23 Aug
'07
10:35 p.m.
Josef Grahn
Hello,
I encountered the following inconsistency constructing a boost::function object from a pointer to a template function.
template <typename T> void foo(T) {}
int main(int argc, char **argv) { boost::function
f1; f1 = foo<int>; boost::function f2 = foo<int>; f1(0); // ok f2(0); // error, function pointer is zero!
return 0; }
I am compiling on MSVC2005 SP1, using boost version 1.34.1.
Maybe it is the same problem as depicted in thread 'Boost.Function and template function', although I did use VStudio 2003. I also post it on a m$ newsgroup, but got no reaction from M$. Mr. Abrahams has obviously better contacts there (see his reaction)...