Boost logo

Boost Users :

From: Robert Dailey (rcdailey_at_[hidden])
Date: 2008-03-04 19:38:53


Hi,

Suppose I have the following code:

template< typename T >
void DoFoo( int number, T object )
{
}

void main()
{
    std::list<std::string> myStrings;

    // Assume myStrings is full of something...

    std::for_each( myStrings.begin(), myStrings.end(), boost::bind( &DoFoo,
5, _1 ) );
}

On MSVC 9, this will not compile because DoFoo is a template, and at some
point, boost::bind can't take a template as the function to call, or it
can't deduce the function's template arguments. Is there a way I can make
this work? Thanks.



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