MoreLinq
GenerateByIndex<(Of <(<'TResult>)>)> Method (generator)
NamespacesMoreLinqMoreEnumerableGenerateByIndex<(Of <<'(TResult>)>>)(Func<(Of <<'(Int32, TResult>)>>))
Returns a sequence of values based on indexes.
Declaration Syntax
C#Visual BasicVisual C++
public static IEnumerable<TResult> GenerateByIndex<TResult>(
	Func<int, TResult> generator
)
Public Shared Function GenerateByIndex(Of TResult) ( _
	generator As Func(Of Integer, TResult) _
) As IEnumerable(Of TResult)
public:
generic<typename TResult>
static IEnumerable<TResult>^ GenerateByIndex(
	Func<int, TResult>^ generator
)
Generic Template Parameters
TResult
Type of result to generate
Parameters
generator (Func<(Of <(<'Int32, TResult>)>)>)
Generation function to apply to each index
Return Value
A sequence
Remarks
The sequence is (practically) infinite - the index ranges from 0 to int.MaxValue inclusive. This function defers execution and streams the results.

Assembly: MoreLinq (Module: MoreLinq.dll) Version: 1.0.16006.0 (1.0.16006.1845)