std.range.RefRange/refRange  - multiple declarations
				Function refRange
Wrapper which effectively makes it possible to pass a range by reference. Both the original range and the RefRange will always have the exact same elements. Any operation done on one will affect the other. So, for instance, if it's passed to a function which would implicitly copy the original range if it were passed to it, the original range is not copied but is consumed as if it were a reference type.
						
				auto refRange(R)
				(
				
				  R* range
				
				)
				
				if (isInputRange!R);
						
					
				Note
save works as normal and operates on a new range, so if
        save is ever called on the RefRange, then no operations on the
        saved range will affect the original.
Parameters
| Name | Description | 
|---|---|
| range | the range to construct the RefRangefrom | 
Returns
A RefRange. If the given range is a class type
        (and thus is already a reference type), then the original
        range is returned rather than a RefRange.
Example
Basic Example
import stdExample
opAssign Example.
ubyte[] buffer1 = [1, 2, 3, 4, 5];
ubyte[] buffer2 = [6, 7, 8, 9, 10];
auto wrapped1 = refRange(&buffer1);
auto wrapped2 = refRange(&buffer2);
assert(wrapped1Struct RefRange
Wrapper which effectively makes it possible to pass a range by reference. Both the original range and the RefRange will always have the exact same elements. Any operation done on one will affect the other. So, for instance, if it's passed to a function which would implicitly copy the original range if it were passed to it, the original range is not copied but is consumed as if it were a reference type.
						
				struct RefRange(R)
				
				  
				
				if (isInputRange!R);
						
					
				Constructors
| Name | Description | 
|---|---|
| this(range) | 
Properties
| Name | Type | Description | 
|---|---|---|
| back[get, set] | auto | Only defined if isBidirectionalRange!Ristrue. | 
| empty[get] | bool | |
| front[get, set] | auto | |
| length[get] | size_t | Only defined if hasLength!Ristrue. | 
| ptr[get] | inout(R*) | A pointer to the wrapped range. | 
| save[get] | auto | Only defined if isForwardRange!Ristrue. | 
Methods
| Name | Description | 
|---|---|
| moveAt(index) | Only defined if hasMobileElements!RandisRandomAccessRange!Raretrue. | 
| moveBack() | Only defined if hasMobileElements!RandisBidirectionalRange!Raretrue. | 
| moveFront() | Only defined if hasMobileElements!RandisForwardRange!Raretrue. | 
| opAssign(rhs) | This does not assign the pointer of rhsto thisRefRange.
        Rather it assigns the range pointed to byrhsto the range pointed
        to by thisRefRange. This is because any operation on aRefRangeis the same is if it occurred to the original range. The
        one exception is when aRefRangeis assignednulleither
        directly or becauserhsisnull. In that case,RefRangeno longer refers to the original range but isnull. | 
| opAssign(rhs) | |
| opIndex(index) | Only defined if isRandomAccessRange!Ristrue. | 
| opSlice() | Only defined if isForwardRange!Ristrue. | 
| opSlice(begin, end) | Only defined if hasSlicing!Ristrue. | 
| popBack() | Only defined if isBidirectionalRange!Ristrue. | 
| popFront() | 
Aliases
| Name | Description | 
|---|---|
| opDollar | Only defined if hasLength!Ristrue. | 
Note
save works as normal and operates on a new range, so if
        save is ever called on the RefRange, then no operations on the
        saved range will affect the original.
Parameters
| Name | Description | 
|---|---|
| range | the range to construct the RefRangefrom | 
Returns
A RefRange. If the given range is a class type
        (and thus is already a reference type), then the original
        range is returned rather than a RefRange.
Example
Basic Example
import stdExample
opAssign Example.
ubyte[] buffer1 = [1, 2, 3, 4, 5];
ubyte[] buffer2 = [6, 7, 8, 9, 10];
auto wrapped1 = refRange(&buffer1);
auto wrapped2 = refRange(&buffer2);
assert(wrapped1Authors
Andrei Alexandrescu, David Simcha, Jonathan M Davis, and Jack Stouffer. Credit for some of the ideas in building this module goes to Leonardo Maffi.