SpanExtensions.Map<T, U> Method

Applies a function to the elements of a span and returns the result in another span.

Definition

Namespace: Numerics.NET.Collections
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2
C#
public static void Map<T, U>(
	this ReadOnlySpan<T> span,
	Func<T, U> function,
	Span<U> result
)

Parameters

span  ReadOnlySpan<T>
A read-only span.
function  Func<T, U>
A function to apply to each element of span.
result  Span<U>
A span that is to hold the result.

Type Parameters

T
The type of the elements of the span.
U
The type of the elements of the result.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ReadOnlySpan<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also