|
Boost Users : |
From: gast128 (gast128_at_[hidden])
Date: 2007-08-23 18:35:34
Josef Grahn <josef.grahn <at> optonova.se> writes:
>
> 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<void (int)> f1;
> f1 = foo<int>;
> boost::function<void (int)> 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)...
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net