View source code
							
							
						
								Display the source code in std/range/interfaces.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								Improve this page
							
							
					
								Quickly fork, edit online, and submit a pull request for this page.
								Requires a signed-in GitHub account. This works well for small changes.
								If you'd like to make larger changes you may want to consider using
								local clone.
							
						Module std.range.interfaces
This module is a submodule of std.
The main std module provides template-based tools for working with
ranges, but sometimes an object-based interface for ranges is needed, such as
when runtime polymorphism is required. For this purpose, this submodule
provides a number of object and interface definitions that can be used to
wrap around range objects created by the std templates.
| 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. | 
| RandomAccessAssignable | 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 the OutputRangeinterface and wraps theputmethods in virtual functions. | 
| outputRangeObject | Convenience function for creating an OutputRangeObjectwith a base
        range of type R that accepts types E. | 
| InputRangeObject | Class that implements the InputRangeinterface and wraps the
        input range methods in virtual functions. | 
| inputRangeObject | Convenience function for creating an InputRangeObjectof the proper type. | 
| MostDerivedInputRange | Returns the interface type that best matches the range. | 
Functions
| Name | Description | 
|---|---|
| 
									inputRangeObject(range)
								 | Convenience function for creating an InputRangeObjectof the proper type.
 SeeInputRangefor an example. | 
Interfaces
| Name | Description | 
|---|---|
| 
									BidirectionalAssignable
								 | Adds assignable elements to BidirectionalRange. | 
| 
									BidirectionalRange
								 | Interface for a bidirectional range of type E. | 
| 
									ForwardAssignable
								 | Adds assignable elements to ForwardRange. | 
| 
									ForwardRange
								 | Interface for a forward range of type E. | 
| 
									InputAssignable
								 | Adds assignable elements to InputRange. | 
| 
									InputRange
								 | These interfaces are intended to provide virtual function-based wrappers
 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
 isInputRange
 and friends check for conformance to structural interfaces
 not for implementation of these interfacetypes. | 
| 
									OutputRange
								 | Interface for an output range of type E.  Usage is similar to theInputRangeinterface and descendants. | 
| 
									RandomAccessFinite
								 | Interface for a finite random access range of type E. | 
| 
									RandomAccessInfinite
								 | Interface for an infinite random access range of type E. | 
| 
									RandomFiniteAssignable
								 | Adds assignable elements to RandomAccessFinite. | 
Classes
| Name | Description | 
|---|---|
| 
									OutputRangeObject
								 | Implements the OutputRangeinterface for all types E and wraps theputmethod for each typeEin a virtual function. | 
Templates
| Name | Description | 
|---|---|
| 
									outputRangeObject
								 | Convenience function for creating an OutputRangeObjectwith a base range
 of typeRthat accepts typesE. | 
Aliases
| Name | Type | Description | 
|---|---|---|
| InputRangeObject | R | Implements the most derived interface that Rworks with and wraps
 all relevant range primitives in virtual functions.  IfRis already
 derived from theInputRangeinterface, aliases itself away. | 
| MostDerivedInputRange | RandomAccessInfinite!E | Returns the interface type that best matches R. | 
Authors
Andrei Alexandrescu, David Simcha, and Jonathan M Davis. Credit for some of the ideas in building this module goes to Leonardo Maffi.
License
					Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.