     ///   should be ordered before its second argument; otherwise, `false`.
     ///
     /// - SeeAlso: MutableCollection.sort(by:), sorted(by:)
-    public mutating func sort(by areInIncreasingOrder: (Element, Element) -> Bool) {
-        _orderedKeys = _sortedElements(by: areInIncreasingOrder).map { $0.key }
+    public mutating func sort(
+        by areInIncreasingOrder: (Element, Element) throws -> Bool
+    ) rethrows {
+        _orderedKeys = try _sortedElements(by: areInIncreasingOrder).map { $0.key }
     }
     
     /// Returns a new ordered dictionary, sorted using the given predicate as the comparison between 

    ///
    /// - Parameter areInIncreasingOrder: The sort function which compares the key-value pairs.
    /// - Returns: The ordered dictionary.
    public func sorted(
        by areInIncreasingOrder: (Element, Element) throws -> Bool
    ) rethrows -> OrderedDictionary<Key, Value> {

    ///
    /// - SeeAlso: MutableCollection.sorted(by:), sort(by:)
    /// - MutatingVariant: sort
    public func sorted(
        by areInIncreasingOrder: (Element, Element) throws -> Bool
    ) rethrows -> OrderedDictionary<Key, Value> {
        return OrderedDictionary(try _sortedElements(by: areInIncreasingOrder))
    }
    
    private func _sortedElements(
        by areInIncreasingOrder: (Element, Element) throws -> Bool
    ) rethrows -> [Element] {
        return try sorted(by: areInIncreasingOrder)
    }
    
    // ======================================================= //
