|
Enhanced C#
Loyc library documentation
|
A mutable forward range. More...
A mutable forward range.
This range lets you change the value of First.
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:
Additional Inherited Members | |
Properties inherited from Loyc.Collections.IHasFirst< out T > | |
| T | First [get] |
| Gets the first item in the deque. More... | |
Properties inherited from Loyc.Collections.IIsEmpty | |
| bool | IsEmpty [get] |
Properties inherited from Loyc.Collections.IHasMFirst< T > | |
| new T | First [get, set] |
Public Member Functions inherited from Loyc.Collections.IFRange< out T > | |
| T | PopFirst (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 () |
1.8.7