Jan 26, 2018 at 9:50am UTC
Hi,
Let's say I have a C++ code with 3 libraries, A, B, and C, each containing .h, .inl, and a few .cpp files. Most of the classes and functions are templated and the libraries contain many files. Files of Library A are included in Library B, and files of libraries A and B are included in Library C. I want to hire someone to work on some files in Library B, but I don't want that person to know about the functions definitions in Library A and C. However, to compile the code, the person will need to access the .h and .inl files, and therefore access the functions définitions of the templated classes and functions. How can I go around that?
Thank you for your help!
Jan 26, 2018 at 10:51am UTC
The problem main problem is dealing with templates. So the trick is to use pre-instantiated templates. That way you can put the template implementation code in a separate .cpp file within each library, and only expose the definitions in the header file.
There's a demonstation of the technique here:
http://www.cplusplus.com/forum/unices/7252/#msg33687
Last edited on Jan 26, 2018 at 10:53am UTC