Skip to content

Commit

Permalink
Merge pull request #765 from ntrel/InputRange-doc-fixes
Browse files Browse the repository at this point in the history
InputRange doc fixes
  • Loading branch information
andralex committed Sep 2, 2012
2 parents 68cb1ff + d064392 commit 6ba8f8c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions std/range.d
Original file line number Diff line number Diff line change
Expand Up @@ -6188,15 +6188,13 @@ unittest
* around input ranges with element type E. This is useful where a well-defined
* binary interface is required, such as when a DLL function or virtual function
* needs to accept a generic range as a parameter. Note that
* $(D isInputRange) and friends check for conformance to structural
* $(LREF isInputRange) and friends check for conformance to structural
* interfaces, not for implementation of these $(D interface) types.
*
* Examples:
* ---
* class UsesRanges {
* void useRange(InputRange range) {
* // Function body.
* }
* void useRange(InputRange!int range) {
* // Function body.
* }
*
* // Create a range type.
Expand All @@ -6206,8 +6204,7 @@ unittest
* auto squaresWrapped = inputRangeObject(squares);
*
* // Use it.
* auto usesRanges = new UsesRanges;
* usesRanges.useRange(squaresWrapped);
* useRange(squaresWrapped);
* ---
*
* Limitations:
Expand All @@ -6218,6 +6215,8 @@ unittest
*
* Length is not propagated in the case of non-random access ranges.
*
* See_Also:
* $(LREF inputRangeObject)
*/
interface InputRange(E) {
///
Expand Down Expand Up @@ -6526,7 +6525,9 @@ template InputRangeObject(R) if (isInputRange!(Unqual!R)) {
}
}

/**Convenience function for creating a $(D InputRangeObject) of the proper type.*/
/**Convenience function for creating an $(D InputRangeObject) of the proper type.
* See $(LREF InputRange) for an example.
*/
InputRangeObject!R inputRangeObject(R)(R range) if (isInputRange!R) {
static if (is(R : InputRange!(ElementType!R))) {
return range;
Expand All @@ -6535,7 +6536,7 @@ InputRangeObject!R inputRangeObject(R)(R range) if (isInputRange!R) {
}
}

/**Convenience function for creating a $(D OutputRangeObject) with a base range
/**Convenience function for creating an $(D OutputRangeObject) with a base range
* of type $(D R) that accepts types $(D E).
Examples:
Expand Down

0 comments on commit 6ba8f8c

Please sign in to comment.