Enhanced C#
Language of your choice: library documentation

Documentation moved to ecsharp.net

GitHub doesn't support HTTP redirects, so you'll be redirected in 3 seconds.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Properties | List of all members
Loyc.Collections.IMFRange< T > Interface Template Reference

A mutable forward range. More...


Source file:
Inheritance diagram for Loyc.Collections.IMFRange< T >:
Loyc.Collections.IFRange< out T > Loyc.ICloneable< out T > Loyc.Collections.IIsEmpty Loyc.Collections.IMBRange< T > Loyc.Collections.IMRange< T > Loyc.Collections.ArraySlice< T >

Remarks

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:

var r2 = (IMFRange&lt;T>)r.Clone();

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 >
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 >
PopFront (out bool fail)
 Removes the first item from the range and returns it. More...
 
- Public Member Functions inherited from Loyc.ICloneable< out T >
Clone ()
 

Property Documentation

new T Loyc.Collections.IMFRange< T >.Front
getset

Gets or sets the value of the first item in the range.

Exceptions
EmptySequenceExceptionThe sequence is empty.