Boost logo

Boost Users :

Subject: Re: [Boost-users] [Bind] Unresolved overloaded function type
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2011-08-21 03:31:14


On Fri, Aug 19, 2011 at 10:37 AM, Robert Jones <robertgbjones_at_[hidden]> wrote:
> Hi All
> Can anyone tell me how to fix this? It's fine with one Fedora/Boost version
> combination, but not with another!

Which one would that be?

Possibilities:
1) Use boost::bind and cast max to the right function type (ugly):
    bind(static_cast<X(*)(X, X)>(&std::max), ....)

OR

2) Use boost::phoenix (if you have 1.47 or above):

    2.1) Adapt the max function:
http://www.boost.org/doc/libs/1_47_0/libs/phoenix/doc/html/phoenix/modules/function/adapting_functions.html#phoenix.modules.function.adapting_functions.boost_phoenix_adapt_function

OR

   2.2) Use some shortcut syntax: boost::phoenix::bind<X(X, X)>(&std::max, ...)

HTH,

Thomas


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