
AMDG Rodolfo Federico Gamarra wrote:
Hello Boost users,
I'm working on my thesis with the Boost library (Boost-1.34.1) running on g++ (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2).
What I'm trying to do can be done very simply, but I preferred to do it more appropriately, I believe, using the Boost Min-Max library. I'm trying to simultaneously obtain the maximum and minimum values of a member function call over a lists of objects.
Suppose there exists a class utl::Particle; with a member function double GetEnergy() const;
In a member field of another class I have a list of those particles std::listutl::Particle particles; for which I want min/max GetEnergy() values.
How is that accomplished using Boost.Min-Max?
Use minmax_element rather than minmax.
#include