1) super thanks this helps me understand lamda's a lot better
2)in c++ ref the function std::max_element<> has 2 generic arguments one of is <fowardIt> (which is self-explanatory)
and the second one is <class Compare> what is it for?
3)which of these 2 methods is preferable in terms of modern coding styles (from a performance perspective they are the same)
1 2 3
int max_length = 0;
for (Edge * e: whGraph->get_outgoing_edges_of_a_vertex(v))
max_length = std::max<int>(max_length, e->Length());
Ah didn't see this. Yes, I agree with TheIdeasMan. Template arguments by their nature are essentially "duck typing". So the Compare template argument is used like a 2-arg function that dereferences the two ForwardIt objects, so any function or function object that matches this and return something convertible into a bool will compile.
I also think the first excerpt is easier to read. While it is good to know what tools the standard library has available, sometimes it's easier to just keep it simple.