
6 Mar
2013
6 Mar
'13
11:06 p.m.
Dear all, i got a compilation error with vstudio 2010 and Boost.Function: 1) pass functor in constructor 2) pass functor as assignment 3) use Boost.Ref 4) temporary function void foo() { std::identity<int> bla; boost::function<int (int)> fc(bla); boost::function<int (int)> fc2 = bla; boost::function<int (int)> fc(boost::ref(bla)); boost::function<int (int)>(bla); //<-- } first 3 are ok, but the last one vstudio sees this as redefintion of bla of type 'boost::function<int (int)>. What (and why) do I wrong or should use an explicit cast in the last case?