
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?
Below I give some excerpts of some of the things I've tried, but didn't
work. In order to try to understand what I was doing I split the code over
several lines, so to minimize the non-compiling one. In both cases the error
seems to be (that line is what I believe to be the most important part of
all the error messages):
boost/iterator/iterator_adaptor.hpp:353: error: no match for 'operator-'
in...
First attempt:
boost::function