xxsds / DYNAMIC

Dynamic succinct/compressed data structures
MIT License
111 stars 20 forks source link

Template Specializations in Header File #1

Closed adamnovak closed 8 years ago

adamnovak commented 8 years ago

The dynamic.hpp header has some template specializations in it, which means that if it is included in multiple compilation units, it produces a multiple definitions linker error when you go to link them together (because the object code for the specializations gets generated twice). If you want to use template specializations like that, you need to put them in a .cpp file and generate an object file to hold them.

I think an alternative may be to make the specializations themselves still templates, somehow. Or to inline the specializations.

adamnovak commented 8 years ago

There's also get_frequencies which is just a function chilling out in a header, with the same linker-confusing results.