Seems like I forgot a typename ... Something inside my head keeps telling me that I have stumbled across a Dictionary that basicly uses a user-defined Comparer for lookups. But I somehow can't find that class in the depths of .Net anymore.
As I have no real idea how to describe what I am looking for without describing a possible implmenentation, I will also give an example of what I wan't to do.
I am basicly looking for a way to achieve the following (pseudocode):
class CustomId
{
// [...]
}
class Element
{
CustomId id;
}
Container<CustomId, Element> myContainer = new Container(myCustomComparer)
myContainer.Add(new Element()) // No key specified
myElement = myContainer[new CustomId(...)]; // Retrieval with custom id
Maybe this technically isn't quite a dictionary, but I hope the idea is clear. Basicly the key is part of the stored element.