| InputRange | Wrapper for input ranges. |
| InputAssignable | Wrapper for input ranges with assignable elements. |
| ForwardRange | Wrapper for forward ranges. |
| ForwardAssignable | Wrapper for forward ranges with assignable elements. |
| BidirectionalRange | Wrapper for bidirectional ranges. |
| BidirectionalAssignable | Wrapper for bidirectional ranges with assignable elements. |
| RandomAccessFinite | Wrapper for finite random-access ranges. |
| RandomFiniteAssignable | Wrapper for finite random-access ranges with assignable elements. |
| RandomAccessInfinite | Wrapper for infinite random-access ranges. |
| OutputRange | Wrapper for output ranges. |
| OutputRangeObject | Class that implements theOutputRange interface and wraps theput methods in virtual functions. |
| outputRangeObject | Convenience function for creating anOutputRangeObject with a base range of type R that accepts types E. |
| InputRangeObject | Class that implements theInputRange interface and wraps the input range methods in virtual functions. |
| inputRangeObject | Convenience function for creating anInputRangeObject of the proper type. |
| MostDerivedInputRange | Returns the interface type that best matches the range. |
Sourcestd/range/interfaces.d
InputRange(E);LimitationsThese interfaces are not capable of forwardingref access to elements.
Infiniteness of the wrapped range is not propagated. Length is not propagated in the case of non-random access ranges.import std.algorithm.iteration : map;import std.range : iota;void useRange(InputRange!int range) {// Function body.}// Create a range type.auto squares = map!"a * a"(iota(10));// Wrap it in an interface.auto squaresWrapped = inputRangeObject(squares);// Use it.useRange(squaresWrapped);
front();moveFront();popFront();empty();opApply(scope int delegate(E));opApply(scope int delegate(size_t, E));ForwardRange(E): InputRange!E;save();BidirectionalRange(E): ForwardRange!E;save();back();moveBack();popBack();RandomAccessFinite(E): BidirectionalRange!E;save();opIndex(size_t);moveAt(size_t);length();opDollar = length;opSlice(size_t, size_t);RandomAccessInfinite(E): ForwardRange!E;empty;moveAt(size_t);save();opIndex(size_t);InputAssignable(E): InputRange!E;front(EnewVal);ForwardAssignable(E): InputAssignable!E, ForwardRange!E;save();BidirectionalAssignable(E): ForwardAssignable!E, BidirectionalRange!E;save();back(EnewVal);RandomFiniteAssignable(E): RandomAccessFinite!E, BidirectionalAssignable!E;save();opIndexAssign(Eval, size_tindex);OutputRange(E);put(E);OutputRangeObject(R, E...): staticMap!(OutputRange, E);range);MostDerivedInputRange(R) if (isInputRange!(Unqual!R))InputRangeObject(R) if (isInputRange!(Unqual!R))inputRangeObject(R)(Rrange)outputRangeObject(E...)import std.array;auto app = appender!(uint[])();auto appWrapped =outputRangeObject!(uint,uint[])(app);staticassert(is(typeof(appWrapped) : OutputRange!(uint[])));staticassert(is(typeof(appWrapped) : OutputRange!(uint)));
outputRangeObject(R)(Rrange);UnsupportedRangeMethod:object.Exception;