
13 Mar
2008
13 Mar
'08
11:33 p.m.
Can anyone explain to me why VC++ 2008 refuses to compile this code: void empty() { } template <class T> void foo(T t) { // error C2664: 'void (T)' : cannot convert // parameter 1 from 'void' to 'boost::_bi::bind_t<R,F,L>' boost::bind(bar<T>, t)(); // This one works though: boost::bind(bar<T>, _1)(t); } template <class T> void bar(T t) { t(); } int main() { foo(boost::bind(empty)); } Is this a problem with the VC++ 2008 compiler or am I trying to do something which isn't supported by Boost.Bind? Boris