#ifndef MAX_FUNC_OBJECT_HEADER_INCLUDED #define MAX_FUNC_OBJECT_HEADER_INCLUDED class Max { double max; public: Max(double init = 0.0) : max(init) {} double operator()(void) const { return max; } double operator()(double next) { return max = next > max ? next : max; } void reset(double init = 0.0) { max = init; return; } }; #endif