Getting the last element of an iterator

There’s a practical problem though in adding a generic last for iterators: I don’t see how to decide efficiently between calling a[end] (whenever possible) and calling the slow fallback.

There is no default trait for getindex/lastindex (no generic definition of Base.IndexStyle for example) and using applicable(lastindex, a) would incur an unacceptable performance penalty for something as basic as last