Henri Verbeet hverbeet@codeweavers.com writes:
Alexandre Julliard wrote:
Yes, that looks fine. It would probably look nicer to merge the allocator and the compare function into a single structure, and just store a pointer to it like a vtbl; but that's a minor detail.
It's easy enough to store a pointer to the allocator instead of making a copy, but wouldn't merging the compare function into the same structure be inconvenient when using multiple trees with different compare functions but the same allocator, like in in wined3d?
You could still share the allocations functions of course, you'd only need an extra structure. My feeling is that having all the functions described in the same structure makes the interface cleaner, even if it means you need one such structure for each usage of the tree. But it's a cosmetic detail, I don't feel strongly about it.