Method Create
Create<T>(ImmutableArray<T>)
Returns a ComparerEquatableArray<T> containing the specified items that uses the default comparer.
Declaration
public static ComparerEquatableArray<T> Create<T>(ImmutableArray<T> items)
Parameters
| Type | Name | Description |
|---|---|---|
| ImmutableArray<T> | items |
Returns
| Type | Description |
|---|---|
| ComparerEquatableArray<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
The values in the array are assumed to be immutable and interchangeable. Equal values must stay equal and keep the same hash code indefinitely, and a value read from the array is only guaranteed to be equal to the one that was passed in, not to be the same instance.
Create<T>(IEnumerable<T>)
Returns a ComparerEquatableArray<T> containing the specified items that uses the default comparer.
Declaration
public static ComparerEquatableArray<T> Create<T>(IEnumerable<T> items)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | items |
Returns
| Type | Description |
|---|---|
| ComparerEquatableArray<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
The values in the array are assumed to be immutable and interchangeable. Equal values must stay equal and keep the same hash code indefinitely, and a value read from the array is only guaranteed to be equal to the one that was passed in, not to be the same instance.
Create<T>(params ReadOnlySpan<T>)
Returns a ComparerEquatableArray<T> containing the specified items that uses the default comparer.
Declaration
public static ComparerEquatableArray<T> Create<T>(params ReadOnlySpan<T> items)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<T> | items |
Returns
| Type | Description |
|---|---|
| ComparerEquatableArray<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
The values in the array are assumed to be immutable and interchangeable. Equal values must stay equal and keep the same hash code indefinitely, and a value read from the array is only guaranteed to be equal to the one that was passed in, not to be the same instance.
Create<T>(params T[])
Returns a ComparerEquatableArray<T> containing the specified items that uses the default comparer.
Declaration
public static ComparerEquatableArray<T> Create<T>(params T[] items)
Parameters
| Type | Name | Description |
|---|---|---|
| T[] | items |
Returns
| Type | Description |
|---|---|
| ComparerEquatableArray<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
The values in the array are assumed to be immutable and interchangeable. Equal values must stay equal and keep the same hash code indefinitely, and a value read from the array is only guaranteed to be equal to the one that was passed in, not to be the same instance.
Create<T>(IEqualityComparer<T>?, ImmutableArray<T>)
Returns a ComparerEquatableArray<T> containing the specified items that uses the specified comparer, or the default comparer if null is specified.
Declaration
public static ComparerEquatableArray<T> Create<T>(IEqualityComparer<T>? comparer, ImmutableArray<T> items)
Parameters
| Type | Name | Description |
|---|---|---|
| IEqualityComparer<T> | comparer | |
| ImmutableArray<T> | items |
Returns
| Type | Description |
|---|---|
| ComparerEquatableArray<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
The values in the array are assumed to be immutable and interchangeable. Equal values must stay equal and keep the same hash code indefinitely, and a value read from the array is only guaranteed to be equal to the one that was passed in, not to be the same instance.
Comparers are compared by reference when determining whether two arrays are equal, with null treated as equivalent to Default.
Create<T>(IEqualityComparer<T>?, IEnumerable<T>)
Returns a ComparerEquatableArray<T> containing the specified items that uses the specified comparer, or the default comparer if null is specified.
Declaration
public static ComparerEquatableArray<T> Create<T>(IEqualityComparer<T>? comparer, IEnumerable<T> items)
Parameters
| Type | Name | Description |
|---|---|---|
| IEqualityComparer<T> | comparer | |
| IEnumerable<T> | items |
Returns
| Type | Description |
|---|---|
| ComparerEquatableArray<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
The values in the array are assumed to be immutable and interchangeable. Equal values must stay equal and keep the same hash code indefinitely, and a value read from the array is only guaranteed to be equal to the one that was passed in, not to be the same instance.
Comparers are compared by reference when determining whether two arrays are equal, with null treated as equivalent to Default.
Create<T>(IEqualityComparer<T>?, params ReadOnlySpan<T>)
Returns a ComparerEquatableArray<T> containing the specified items that uses the specified comparer, or the default comparer if null is specified.
Declaration
public static ComparerEquatableArray<T> Create<T>(IEqualityComparer<T>? comparer, params ReadOnlySpan<T> items)
Parameters
| Type | Name | Description |
|---|---|---|
| IEqualityComparer<T> | comparer | |
| ReadOnlySpan<T> | items |
Returns
| Type | Description |
|---|---|
| ComparerEquatableArray<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
The values in the array are assumed to be immutable and interchangeable. Equal values must stay equal and keep the same hash code indefinitely, and a value read from the array is only guaranteed to be equal to the one that was passed in, not to be the same instance.
Comparers are compared by reference when determining whether two arrays are equal, with null treated as equivalent to Default.
Create<T>(IEqualityComparer<T>?, params T[])
Returns a ComparerEquatableArray<T> containing the specified items that uses the specified comparer, or the default comparer if null is specified.
Declaration
public static ComparerEquatableArray<T> Create<T>(IEqualityComparer<T>? comparer, params T[] items)
Parameters
| Type | Name | Description |
|---|---|---|
| IEqualityComparer<T> | comparer | |
| T[] | items |
Returns
| Type | Description |
|---|---|
| ComparerEquatableArray<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
The values in the array are assumed to be immutable and interchangeable. Equal values must stay equal and keep the same hash code indefinitely, and a value read from the array is only guaranteed to be equal to the one that was passed in, not to be the same instance.
Comparers are compared by reference when determining whether two arrays are equal, with null treated as equivalent to Default.