Class SpanExtensions
Extension methods for
Inheritance
Namespace: X10D.Core
Assembly: X10D.dll
Syntax
public static class SpanExtensions : object
Methods
| Improve this Doc View SourceContains<T>(ReadOnlySpan<T>, T)
Returns a value indicating whether a specific enumeration value is contained with the current readonly span of elements.
Declaration
public static bool Contains<T>(this ReadOnlySpan<T> span, T value)
where T : struct, Enum
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<T> | span | The readonly span of elements. |
T | value | The value to search for. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in |
Contains<T>(Span<T>, T)
Returns a value indicating whether a specific enumeration value is contained with the current span of elements.
Declaration
public static bool Contains<T>(this Span<T> span, T value)
where T : struct, Enum
Parameters
Type | Name | Description |
---|---|---|
Span<T> | span | The span of elements. |
T | value | The value to search for. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in |
PackByte(ReadOnlySpan<Boolean>)
Packs a
Declaration
public static byte PackByte(this ReadOnlySpan<bool> source)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<System.Boolean> | source | The span of booleans to pack. |
Returns
Type | Description |
---|---|
System.Byte | An 8-bit unsigned integer containing the packed booleans. |
PackByte(Span<Boolean>)
Packs a
Declaration
public static byte PackByte(this Span<bool> source)
Parameters
Type | Name | Description |
---|---|---|
Span<System.Boolean> | source | The span of booleans to pack. |
Returns
Type | Description |
---|---|
System.Byte | An 8-bit unsigned integer containing the packed booleans. |
PackInt16(ReadOnlySpan<Boolean>)
Packs a
Declaration
public static short PackInt16(this ReadOnlySpan<bool> source)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<System.Boolean> | source | The span of booleans to pack. |
Returns
Type | Description |
---|---|
System.Int16 | A 16-bit signed integer containing the packed booleans. |
PackInt16(Span<Boolean>)
Packs a
Declaration
public static short PackInt16(this Span<bool> source)
Parameters
Type | Name | Description |
---|---|---|
Span<System.Boolean> | source | The span of booleans to pack. |
Returns
Type | Description |
---|---|
System.Int16 | A 16-bit signed integer containing the packed booleans. |
PackInt32(ReadOnlySpan<Boolean>)
Packs a
Declaration
public static int PackInt32(this ReadOnlySpan<bool> source)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<System.Boolean> | source | The span of booleans to pack. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer containing the packed booleans. |
PackInt32(Span<Boolean>)
Packs a
Declaration
public static int PackInt32(this Span<bool> source)
Parameters
Type | Name | Description |
---|---|---|
Span<System.Boolean> | source | The span of booleans to pack. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer containing the packed booleans. |
PackInt64(ReadOnlySpan<Boolean>)
Packs a
Declaration
public static long PackInt64(this ReadOnlySpan<bool> source)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<System.Boolean> | source | The span of booleans to pack. |
Returns
Type | Description |
---|---|
System.Int64 | A 64-bit signed integer containing the packed booleans. |
PackInt64(Span<Boolean>)
Packs a
Declaration
public static long PackInt64(this Span<bool> source)
Parameters
Type | Name | Description |
---|---|---|
Span<System.Boolean> | source | The span of booleans to pack. |
Returns
Type | Description |
---|---|
System.Int64 | A 64-bit signed integer containing the packed booleans. |