Boost logo

Boost Users :

Subject: Re: [Boost-users] phoenix bind template parameter
From: Nate Crookston (nathan.crookston_at_[hidden])
Date: 2014-12-06 08:05:47


Hi Phil,

Since std::pow has a few different overloads (for things like long double
std::complex, etc.) you're probably running into the problem described
here: <
http://www.boost.org/doc/libs/1_57_0/libs/bind/bind.html#err_overloaded>
 The solution it suggests will work in your case.

Happily, phoenix makes it easy to call cmath functions by wrapping them in
this file:
<
https://github.com/boostorg/phoenix/blob/master/include/boost/phoenix/stl/cmath.hpp>
So you should be able to call pow without messing with bind.

HTH,
Nate

On Wed, Dec 3, 2014 at 1:34 PM, Philipp Kraus <philipp.kraus_at_[hidden]>
wrote:

> Hello,
>
> I try to use phoenix bind to bind std::pow for double values, but I get
> errors, because the template parameters not set:
>
> phoenix::bind(&std::pow, _val, _1)
>
> I would like to compile it with C++11. How can I setup the template
> parameter on the phoenix bind?
> At the moment I have defined a function double mypow(double a, double b) {
> return std::pow(a,b); }
> but can I do this directly with std::pow in the bind call?
>
> Thanks a lot
>
> Phil
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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