Method IndexOf
- Namespace
- SodaFlow.Collections
- Assembly
- SodaFlow.Collections.dll
IndexOf<TKey, TIdentity, TState>(OrderedKeys<TKey, TIdentity, TState>, TKey)
The position of a key in an ordered set, when the set has that key.
[Pure]
public static Maybe<int> IndexOf<TKey, TIdentity, TState>(this OrderedKeys<TKey, TIdentity, TState> keys, TKey key) where TKey : notnull where TIdentity : notnull
Parameters
keysOrderedKeys<TKey, TIdentity, TState>The ordered set to look in.
keyTKeyThe key to look for.
Returns
Type Parameters
TKeyThe type of the keys.
TIdentityThe type of the immutable part of an item.
TStateThe type of the mutable part of an item.
Remarks
The core answers -1 for a missing key, which is the convention of each
other IndexOf in the framework, and it keeps that answer private.
This is the only IndexOf in the public C# API, and it answers as the
other parts of the C# API do.