The Boost documentation doesn't elaborate much, but there is an (optional) KeyCompare function that can be passed to the ptree.
Anyone have a good example of using a custom KeyCompare function?
I have recently been working with a ptree that is real slow. My keys are long strings (paths), and I assuming it's the string comparisons that make it slow.
From what I can glean, the default KeyCompare is std::less(), I want to change this. I think something that just compares the hashes of the two strings.
It goes without saying (but I'll say it anyway) that I would use a different object for the key to facilitate this: Something that has (std::string+hash), rather than just a std::string. The hash would be calculated during construction.
Thanks, Rik.