SpanExtensions.All Method

Definition

Namespace: Numerics.NET.Collections
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2

Overload List

All<T>(ReadOnlySpan<T>, Func<T, Boolean>) Returns true if all elements of a span satisfy the specified predicate.
All<T, TPredicate>(ReadOnlySpan<T>, TPredicate) Returns true if all elements of a span satisfy the specified 'fast' predicate.

All<T>(ReadOnlySpan<T>, Func<T, Boolean>)

Returns true if all elements of a span satisfy the specified predicate.
C#
public static bool All<T>(
	this ReadOnlySpan<T> span,
	Func<T, bool> predicate
)

Parameters

span  ReadOnlySpan<T>
A read-only span.
predicate  Func<T, Boolean>
The predicate to test the elements of span.

Type Parameters

T
The type of the elements of the span.

Return Value

Boolean
true if all elements of span satisfy predicate; otherwise false.

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).

Remarks

If the span is empty, the result is true.

All<T, TPredicate>(ReadOnlySpan<T>, TPredicate)

Returns true if all elements of a span satisfy the specified 'fast' predicate.
C#
public static bool All<T, TPredicate>(
	this ReadOnlySpan<T> span,
	TPredicate predicate
)
where TPredicate : Object, IFastFunc<T, bool>

Parameters

span  ReadOnlySpan<T>
A read-only span.
predicate  TPredicate
The predicate to test the elements of span.

Type Parameters

T
The type of the elements of the span.
TPredicate
The type of predicate.

Return Value

Boolean
true if all elements of span satisfy predicate; otherwise false.

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).

Remarks

If the span is empty, the result is true.

See Also