Boost logo

Boost Users :

From: Boris (boriss_at_[hidden])
Date: 2008-03-13 19:33:38


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


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