alright so thanks to your help I was also able to obtain my Min value in a similar way:
Code:
class Tree{
private:
static bool getMinY(const Coordinate &a, const Coordinate &b);
}
class:
boolTree::getMinY(const Coordinate &a, constCoordinate &b)
{
return a.y < b.y;
}
Coordinate smallestYCoord=*std::min_element(incCoords.begin(), incCoords.end(), getMinY);
double smallestY = smallestYCoord.y
This works like a charm, but in fact I don't really need a coord struct but just the double value returned.
This sounds simple but I don't know how to deal with the return type std::min_element delivers.
Preferably a double value is returned instead of the coord, so I can make use of it like this:
Code:
double smallestY = *std::min_element(incCoords.begin(),incCoords.end(),getMinY);
Edit: nevermind the second idea
Is this possible at all? If too much work is involved I will just use the coord struct=) Thanks in advance!