Index: functional.hpp =================================================================== --- functional.hpp (revision 83352) +++ functional.hpp (working copy) @@ -246,14 +246,21 @@ template struct average_base - : functional::divides - {}; + { + // Define the type of the result + typedef typename functional::divides::result_type result_type; + result_type operator()(Left & left, Right & right) const + { + return numeric::divides(numeric::plus(left, right), 2); + } + }; + // partial specialization that promotes the arguments to double for // integral division. template struct average_base >::type> - : functional::divides + : average_base {}; template