I'm trying to use a ptr_map along with boost property trees. I need to store pointers to specific parts of a built up property tree to access these parts later on for easy insertion there.
However, when the ptr_map is cleared/destroyed, I get memory access violations/stack overflow messages for my test cases.
The ptr_map (typedef treeMap) is globally defined within a std::map to a ptr_map to property trees as follows (I know this isn't good practice, but passing it as a reference didn't make a difference, so I left it that
I already have the suspicion that the memory access violation comes from ptr_map taking ownership of the pointers (references) passed to it in the above three lines and that these are all created on the stack and not
the heap, where ptr_map expects them to be.
When the ptr_map is finally destroyed, it tries to access memory, that's impossible to access...
But I didn't manage to successfully create heap objects that also do NOT copy the property tree objects, which is important as I only need references to the property trees.