Move requirements out of abstracts.

Searched for "/// ..*Requires:" and did manual replacements.

Patch by Alex Martini.

Swift SVN r28465
This commit is contained in:
Dmitri Hrybenko
2015-05-12 07:39:52 +00:00
parent 631a4eff32
commit 1bc7b4c226
5 changed files with 21 additions and 14 deletions

View File

@@ -10,8 +10,9 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Returns the minimum element in `elements`. Requires: /// Returns the minimum element in `elements`.
/// `elements` is non-empty. O(elements.count()) ///
/// Requires: `elements` is non-empty. O(elements.count())
@availability(*, unavailable, message="call the 'minElement()' method on the sequence") @availability(*, unavailable, message="call the 'minElement()' method on the sequence")
public func minElement< public func minElement<
R : SequenceType R : SequenceType
@@ -20,8 +21,9 @@ public func minElement<
return elements.minElement()! return elements.minElement()!
} }
/// Returns the maximum element in `elements`. Requires: /// Returns the maximum element in `elements`.
/// `elements` is non-empty. O(elements.count()) ///
/// Requires: `elements` is non-empty. O(elements.count())
@availability(*, unavailable, message="call the 'maxElement()' method on the sequence") @availability(*, unavailable, message="call the 'maxElement()' method on the sequence")
public func maxElement< public func maxElement<
R : SequenceType R : SequenceType
@@ -282,8 +284,9 @@ public func equal<
} }
/// Return true iff `a1` and `a2` contain equivalent elements, using /// Return true iff `a1` and `a2` contain equivalent elements, using
/// `isEquivalent` as the equivalence test. Requires: `isEquivalent` /// `isEquivalent` as the equivalence test.
/// is an [equivalence relation](http://en.wikipedia.org/wiki/Equivalence_relation) ///
/// Requires: `isEquivalent` is an [equivalence relation](http://en.wikipedia.org/wiki/Equivalence_relation)
@availability(*, unavailable, message="call the 'equal()' method on the sequence") @availability(*, unavailable, message="call the 'equal()' method on the sequence")
public func equal< public func equal<
S1 : SequenceType, S2 : SequenceType S1 : SequenceType, S2 : SequenceType

View File

@@ -426,8 +426,9 @@ extension _ArrayBuffer {
} }
/// Call `body(p)`, where `p` is an `UnsafeMutableBufferPointer` /// Call `body(p)`, where `p` is an `UnsafeMutableBufferPointer`
/// over the underlying contiguous storage. Requires: such /// over the underlying contiguous storage.
/// contiguous storage exists or the buffer is empty ///
/// Requires: such contiguous storage exists or the buffer is empty
public mutating func withUnsafeMutableBufferPointer<R>( public mutating func withUnsafeMutableBufferPointer<R>(
@noescape body: (UnsafeMutableBufferPointer<T>) -> R @noescape body: (UnsafeMutableBufferPointer<T>) -> R
) -> R { ) -> R {

View File

@@ -80,8 +80,9 @@ public protocol _ArrayBufferType : MutableCollectionType {
) -> R ) -> R
/// Call `body(p)`, where `p` is an `UnsafeMutableBufferPointer` /// Call `body(p)`, where `p` is an `UnsafeMutableBufferPointer`
/// over the underlying contiguous storage. Requires: such /// over the underlying contiguous storage.
/// contiguous storage exists or the buffer is empty ///
/// Requires: such contiguous storage exists or the buffer is empty
mutating func withUnsafeMutableBufferPointer<R>( mutating func withUnsafeMutableBufferPointer<R>(
@noescape body: (UnsafeMutableBufferPointer<Element>) -> R @noescape body: (UnsafeMutableBufferPointer<Element>) -> R
) -> R ) -> R

View File

@@ -118,8 +118,9 @@ protocol _ArrayType
S : SequenceType where S.Generator.Element == Self S : SequenceType where S.Generator.Element == Self
>(elements: S) -> Self >(elements: S) -> Self
/// Sort `self` in-place according to `isOrderedBefore`. Requires: /// Sort `self` in-place according to `isOrderedBefore`.
/// `isOrderedBefore` induces a [strict weak ordering](http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings) ///
/// Requires: `isOrderedBefore` induces a [strict weak ordering](http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings)
/// over the elements. /// over the elements.
mutating func sort( mutating func sort(
isOrderedBefore: (Generator.Element, Generator.Element) -> Bool isOrderedBefore: (Generator.Element, Generator.Element) -> Bool

View File

@@ -209,8 +209,9 @@ public func ... <Pos : ForwardIndexType> (
//===--- Prefer Ranges to Intervals, and add checking ---------------------===// //===--- Prefer Ranges to Intervals, and add checking ---------------------===//
/// Forms a half-open range that contains `start`, but not /// Forms a half-open range that contains `start`, but not `end`.
/// `end`. Requires: `start <= end` ///
/// Requires: `start <= end`
@transparent @transparent
public func ..< <Pos : ForwardIndexType where Pos : Comparable> ( public func ..< <Pos : ForwardIndexType where Pos : Comparable> (
start: Pos, end: Pos start: Pos, end: Pos