|
Enhanced C#
Loyc library documentation
|
A sequence of T objects that is meant to be read in chunks. This interface is essentially a faster version of IEnumerable{T}: it allows the caller to scan a sequence faster by avoiding unnecessary interface calls. More...
A sequence of T objects that is meant to be read in chunks. This interface is essentially a faster version of IEnumerable{T}: it allows the caller to scan a sequence faster by avoiding unnecessary interface calls.
Example usage:
public static List<T> AddToList<T>(IScannable<T> sequence, List<T> list){IScanner<T> scanner = sequence.Scan();var current = ReadOnlySpan<T>.Empty;var temp = Memory<T>.Empty;while ((current = scanner.Read(current.Length, 0, ref temp).Span).Length != 0) {for (int i = 0; i < current.Length; i++)list.Add(current[i]);}return list;}]]>
In practice, an object that implements Scan() will also implement IEnumerable{T}, and this interface includes IEnumerable{T} for disambiguation purposes, so that
Additional Inherited Members | |
Public Member Functions inherited from Loyc.Collections.IScan< T > | |
| IScanner< T > | Scan () |
1.8.7