A correct skiplist is easier to NIH than a correct red-black tree (which for me was the final boss of the DS class in college), but has performance edge cases a red-black tree doesnt, if you treat it like a search tree.
I'm sure there's some cleverness in there to mitigate the problem somewhat, but the problem still fundamentally exists
You can mitigate this manually to some degree, by making the generic classes call out to non-generic functions, of which there's guaranteed to be just 1 copy. I'm guessing that's what Qt does (among other things) when mentioning this
- Use an algorithm and implementation that needs a small amount of code for each instance (that is where the skip list is useful)
- Have a shared "out of line" (not inline) implementation for bulky parts of the implementation, where possible
- Support the compiler + linker feature to merge identical functions by making code identical between template instantiations of similar enough types