Enhanced C#
Language of your choice: library documentation
|
A mutable forward range. More...
A mutable forward range.
This range lets you change the value of Front.
Please see IFRange{T} for general documentation about ranges.
The mutable ranges do not include a clone method due to a limitation of C#. C# does not support covariance, which means that every time a derived interface supports cloning, the implementing class is required to write a separate clone method. Read-only ranges already have to implement up to four clone methods: ICloneable{IFRange{T}}, ICloneable{IBRange{T}}, ICloneable{IRange{T}}, and ICloneable{IRangeEx{T}}, and that's in addition to the Clone method for the concrete type! If mutable ranges also supported cloning, they would add up to three more clone methods, which is really getting out of hand.
To limit the maximum number of clone methods to something reasonable, only the immutable ranges have a clone method, but if the original range was mutable then the clone will also be mutable; you just have to cast the result:
Properties | |
new T | Front [get, set] |
Gets or sets the value of the first item in the range. More... | |
Properties inherited from Loyc.Collections.IFRange< out T > | |
T | Front [get] |
Returns the first value in the range, without popping it. More... | |
Properties inherited from Loyc.Collections.IIsEmpty | |
bool | IsEmpty [get] |
Additional Inherited Members | |
Public Member Functions inherited from Loyc.Collections.IFRange< out T > | |
T | PopFront (out bool fail) |
Removes the first item from the range and returns it. More... | |
Public Member Functions inherited from Loyc.ICloneable< out T > | |
T | Clone () |
|
getset |
Gets or sets the value of the first item in the range.
EmptySequenceException | The sequence is empty. |