Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2024-11

THashMap or similar with ansistring as key

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Frb

Google didn't deliver an answer...

If I do
   specialize TDictionary<AnsiString, TMyData>
   specialize T{Fast}HashMap<AnsiString, TMyData>

will it actually has the string content? Or is the string the address in the string variable => and therefore 2 strings with the same text can be different?

And if the latter, how do I get the former?
(generics, or any other place that has such a map)

Reply by email

Sven Barth
to Martin Frb
Martin Frb wrote 9 lines
Google didn't deliver an answer... If I do    specialize TDictionary<AnsiString, TMyData>    specialize T{Fast}HashMap<AnsiString, TMyData> will it actually has the string content? Or is the string the address in the string variable => and therefore 2 strings with the same text can be different?

They should all has the string content.

And if the latter, how do I get the former? (generics, or any other place that has such a map)

You could go up the inheritance chain where a THashFactory descendant is passed in as a parameter one of the parent generic classes and instead pass in a different factory that does what you need. Absolutly not tested, but *should* work.

Regards,
Sven

Reply by email