I’m working on a bigger project which involves multiple libraries statically linked against each other.
E.g.: I have a Library A and Library B. Library B statically links against Lib A.
The problem I’m currently trying to solve is that Library A defines a template function DrawUI
template <typename T>
void DrawUI(T&) = delete;
I would like to be able to specialize this template in Library B. I got this working by specializing the functions in a header inside B but this requires the header to be included somewhere within B. I would much rather prefer to be able to define them somewhere in a cpp instead but not sure if that’s possible.
How are customization points usually implemented (e.g.: std::hash) and I have a similar thing already working with a non templated function that is marked as extern and implemented only in a cpp inside LibraryB so I was hoping I can achieve the same with this template.
Additionally I would like to be able to check at compile time if a specialization exists for a given type within LibraryA to register those functions for later use.
Shiyukai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.