mirror of
https://github.com/apple/swift-collections
synced 2026-11-23 04:24:23 +00:00
We are forced to do this due to an Xcode issue (#364) with underscored module names. This module remains unstable, despite the removal of the underscore. Directly importing it from outside the package remains unsupported. This module and/or its entire contents may go away or change in incompatible ways in any future swift-collections release.
34 lines
1.2 KiB
Swift
34 lines
1.2 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift Collections open source project
|
|
//
|
|
// Copyright (c) 2022 - 2024 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#if COLLECTIONS_SINGLE_MODULE
|
|
import Collections
|
|
#else
|
|
import InternalCollectionsUtilities
|
|
#endif
|
|
|
|
/// This protocol simply lists Collection/Sequence extensions that ought to be
|
|
/// customized for sorted collections.
|
|
///
|
|
/// Conforming to this protocol admittedly doesn't do much, as the default
|
|
/// implementations already exist for most of these requirements
|
|
/// (but they aren't doing the right thing).
|
|
public protocol SortedCollectionAPIChecker: Collection, _SortedCollection
|
|
where Element: Comparable {
|
|
// This one actually does not come with a default implementation.
|
|
func sorted() -> Self
|
|
|
|
// These are also defined on `Sequence`, but the default implementation does
|
|
// a linear search, which isn't what we want.
|
|
func min() -> Element?
|
|
func max() -> Element?
|
|
}
|