
Antonio Piccolboni wrote:
On 2/22/06, Peter Dimov <pdimov@mmltd.net> wrote:
bind( std::accumulate< std::vector<int>::iterator, int >, _1, _2, 0 )
might work.
Thanks Peter, but it does not. Error message
bind_test.cpp: In function 'int main()': bind_test.cpp:33: error: no matching function for call to 'bind(<unknown type>, const boost::lambda::lambda_functor<boost::lambda::placeholder<1> >&, const boost::lambda::lambda_functor<boost::lambda::placeholder<2> >&, int)'
You are right, my g++ 3.4.4 also doesn't like it. MSVC 7.1 does, however, at least with boost::bind. There's always the workaround of using a cast or a temporary function pointer: typedef std::vector<int>::iterator It; int (*pf)( It, It, int ) = std::accumulate; bind( pf, _1, _2, 0 );