Not that I know of. It’s rather an attempt at making the standard library more consistent. The main reason being that the `isOrderedBefore` parameter in `max(isOrderedBefore:)` has the exact same type (`@noescape (Iterator.Element, Iterator.Element) -> Bool`) except that it is allowed to throw. I know that there’s no good reason to not let `max` rethrow, but for the sake of consistency, I figured it would make sense and it would be feasible to let `sort` and `sorted` also rethrow.
> > On Jun 7, 2016, at 12:07 PM, Tim Vermeulen via > > swift-evolution<swift-evolution@swift.org>wrote: > > > > > True, but the cost of being able to restore the original ordering, when > > > that restoration may not be needed at all, is prohibitive. > > > > What about simply restoring the elements, in no particular order? This > > seems like an easy enough task, and I don’t think it requires the sorting > > algorithm to allocate any extra memory (in case no error is thrown, at > > least). > What is the example that motivates this? Is there a widely used comparison > function that throws? > > -Chris > > > _______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution