Does ConditionalWeakTable<TKey, TValue> guarantee insertion order?

85 Views Asked by At

As the title already says, is insertion order guaranteed by ConditionalWeakTable<TKey, TValue>?

Couldn't find any answers for this on the internet, and it doesn't inherit any other collection class from which it could copy the behavior, so no luck there.

I'm using .NET 6, if that makes any difference for the answer.

1

There are 1 best solutions below

0
On

Not a perfect answer, because I don't have a technical justification for it, which would be related to the code of the ConditionalWeakTable or something like that, but the class has been in use at our site since I asked the question and by now I can clearly say:

No, ConditionalWeakTable does NOT keep insertion order.