I want to use the Spring4D TDistinctIterator to get the distinct Values in a TDictionary. Therefore I have the following code:
var
d: TDictionary<Integer, String>;
v: Vector<String>;
begin
d := TDictionary<Integer, String>.Create();
d.Add(1, 'test');
d.Add(2, 'test');
d.Add(3, 'test');
v := TDistinctIterator<string>.Create(d.Values, nil).ToArray();
end;
However, this gives an access violation in the ToArray. Is this a bug or should I use the iterator in another way to achieve the same result?