Using a map from a tree as a map

Hi Everyone,

I have two scripts attached. The first is WriteTreeWithMap.C and it writes a very simple tree with one branch that should be an std::map. The other script is ReadTreeWithMap.C which reads the tree made by the first script.

My problem is that I can access the map and iterate over all of its members but I can’t actually use the keys to access the values (i.e. map[key] causes a crash instead of delivering the value). Where am I going wrong?

Cheers,
Chris
ReadTreeWithMap.C (946 Bytes)
WriteTreeWithMap.C (654 Bytes)

Hi Everyone,

It has been more than a week. Has anyone had a chance to look into my problem?

Cheers,
Chris