
Dear Users, I am using bind to calculate the transform of an initial vector in its element by element power (to a given exponent). I used this syntax std::transform(values.begin(), values.end(), values.begin(),boost::bind(pow,_1,exponent)); but the compiler complains for with error C2780 : expects 2 arguments 3 provided... Do you have any solution/explanation? Thanks in adavnce!

std::transform(values.begin(), values.end(), values.begin(),boost::bind(pow,_1,exponent));
but the compiler complains for with error C2780 : expects 2 arguments 3 provided...
pow() has a lot of overloads, you have to explicitly cast pow to the required function type.

Thanks,
But why the compiler says talks about three arguments provided..there are
only two....(base and exponent)
On 27 April 2011 22:41, Igor R
std::transform(values.begin(), values.end(), values.begin(),boost::bind(pow,_1,exponent));
but the compiler complains for with error C2780 : expects 2 arguments 3 provided...
pow() has a lot of overloads, you have to explicitly cast pow to the required function type. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Ok thanks!
On 28 April 2011 15:06, Igor R
But why the compiler says talks about three arguments provided..there are only two....(base and exponent)
It means bind() call, where you pass 3 args, but it can't realize what "pow" is, so it can't specialize bind template correctly. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Igor R
-
simone pilozzi