For what concerns your code, I am not sure I understand what you mean.
If you use these lines (extracted from your example) as a macro or even directly in the interpreter, they work:
ok, but I don’t want to run this particular code, I wrote it as an example for my question. I want to learn how to use maps in root, original c++ maps or root maps from Tmap.
With c++ maps I have the problem I described above…
In TMap I cannot understand how to use add function… What the arguments must be for a map with a string as key and a structure as value?
If you want to use std maps, you’ll need a dictionary or use aclic as we saw in the previous post.
If you want to use tmap, you have to use as key a pointer to a TObjString object and you should convert your struct to a class inheriting from TObject. TMap requires keys and values to be TObject pointers.