I am currently looking for a way to store tuples of a Key (GUID) and several Objects (all of the same type) in a hashmap.
My approach was to define a new generic type like this:
type TMultiMap<T, V> = TDictonary<T, TObjectList<V>>; //FAILS,
but this is rejected by the compiler.
Is there a readymade multimap implementaion available in Delphi 2010? If not, how can I create one?
That doesn't compile, but this does:
type TMultiMap<T, V: class> = class(TDictionary<T, V>);
But if you want a "real" multimap instead of building an ad-hoc one, check out DeHL. It's got several useful container libraries, including a handful of multimap implementations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With