Table of Contents

Struct CollectionConstructionOptions<TKey>

Namespace
PolyType.Abstractions
Assembly
PolyType.dll

Options for constructing collections.

public readonly struct CollectionConstructionOptions<TKey>

Type Parameters

TKey

The type of keys within the collection. When collections aren't keyed, this is the element type directly.

Inherited Members

Remarks

Construction of any particular collection type may ignore any or all of these properties. To predict whether a collection will use a particular comparer property, check the CollectionComparerOptions enum, as defined by either SupportedComparer or SupportedComparer.

Constructors

CollectionConstructionOptions(CollectionConstructionOptions<TKey>)

Initializes a new instance of the CollectionConstructionOptions<TKey> struct.

public CollectionConstructionOptions(CollectionConstructionOptions<TKey> copyFrom)

Parameters

copyFrom CollectionConstructionOptions<TKey>

A template to copy all properties from.

Properties

Capacity

Gets the initial capacity of the collection.

public int? Capacity { get; init; }

Property Value

int?

Comparer

Gets an optional comparer for the keys or elements in the collection.

public IComparer<TKey>? Comparer { get; init; }

Property Value

IComparer<TKey>

EqualityComparer

Gets an optional equality comparer for the keys or elements in the collection.

public IEqualityComparer<TKey>? EqualityComparer { get; init; }

Property Value

IEqualityComparer<TKey>