Its too long to explain. But in short: std::map only stores unique keys.
It needs custom comparators for custom structs (records). It provides his own comparators for simple types like int, float etc.

And the primary thing in map compression is unique blocks and columns. And it must be fast.
I already use std::map for compression and its fast, i just created a DLL in C++ and pass the map array data (actually pointer) to DLL and it compresses it.
This all works fine and i can live with DLLs, i use SDL and other things anyway that are in DLLs.

But i just wanted to include it in my code, to get rid of the C++ DLL. Then i can also prove myself that std::map kind of "thingy" is possible in Delphi (Pascal) also.
Sadly without generics in older versions.

Take it as an exercise for me. I need one "map" for blocks and one "map" for columns. Currently i created 2 units in Delphi, one for blocks and one for columns.
As you see, without generics, code is duplicated.

Dont worry, i will first finish the compressor in FreePascal, to see if it even finds the correct unique columns and compresses map correctly.
Because i tried many things already in Delphi 7, DeCAL, dcl, etc.. All of them have trouble finding me correct unique blocks and same with columns. All are wrong (ok a bit wrong, but if one is wrong, then whole map is wrong. And will crash the game).

Probably because most of these container libs to not support (custom) comparators, otherwise even std::map doesnt know whats unique block or column and which is not.
And of course column struct is a bit complicated also (it contains small static array in it).


So, i will try to port this to FPC first (actually i already did, but its unfinished).
If it works, then i will see what i will do next with it.