On Sun, Aug 21, 2011 at 8:31 AM, Thomas Heller <thom.heller@googlemail.com> wrote:
On Fri, Aug 19, 2011 at 10:37 AM, Robert Jones <robertgbjones@gmail.com> 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, ...)


Hi Thomas

I'm acutely aware how easily and painlessly Phoenix would solve my problems, but sadly it
won't be an option for me for quite a while in production code.

In the meantime your suggestion 1 nearly works - I found I needed to write

bind(static_cast<const X &(*)(const X &, const X &)>(&std::max), ....)

Thanks for your help.

- Rob.