I am planning to do some utility code for using in other projects, but I am doubting between making it a mostly-headers code, a static library with headers just exposing the interface or something in between. Most of the code will be simple functions that wrap other standard functions but there will be also some bigger functions.
I think I mostly understand the differences between the header approach and the static library approach:
For the headers:
- All the code will be in headers
- Better oportunities for the compiler to inline code
- Every function will have to be compiled every time it is used
For the static library:
- Mixed code between the library and the headers
- Worse oportunities for the compiler to inline code
- Compile once and forget
I have been looking at some code and I have seen both approaches, but I don't know which will be better. Any thoughts?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire