diff --git a/opm/simulators/linalg/ParallelIstlInformation.hpp b/opm/simulators/linalg/ParallelIstlInformation.hpp index b446774ef..58e542293 100644 --- a/opm/simulators/linalg/ParallelIstlInformation.hpp +++ b/opm/simulators/linalg/ParallelIstlInformation.hpp @@ -580,12 +580,17 @@ private: /// /// To be used with ParallelISTLInformation::computeReduction. template - MaskToMinOperator > - makeGlobalMaxFunctor() + auto makeGlobalMaxFunctor() { - return MaskToMinOperator > - (std::pointer_to_binary_function - ((const T&(*)(const T&, const T&))std::max)); + struct MaxOp + { + using result_type = T; + const T& operator()(const T& t1, const T& t2) + { + return std::max(t1, t2); + } + }; + return MaskToMinOperator(MaxOp()); } namespace detail @@ -630,12 +635,18 @@ private: /// /// To be used with ParallelISTLInformation::computeReduction. template - MaskToMaxOperator > + auto makeGlobalMinFunctor() { - return MaskToMaxOperator > - (std::pointer_to_binary_function - ((const T&(*)(const T&, const T&))std::min)); + struct MinOp + { + using result_type = T; + const T& operator()(const T& t1, const T& t2) + { + return std::min(t1, t2); + } + }; + return MaskToMaxOperator(MinOp()); } template InnerProductFunctor