How should I handle the really simple (should-be-inlined) functions with dlls? If I want it to be inlined, it has to be defined in the header. If I mark it with dllexport, it can't be inline.
Inline case:
- faster code (simple getters and setters)
- require recompiling when modifying the implementation
- implementation has to be in the header
- can't "hide" the implementation
Export case:
- possibly slower code because of the stack push/pop and call cost
- recompile just the specific object
- implementation is "hidden"
However, what's about with the templates? Specific functions are generated at compile-time from the template functions, so its implementation cannot be in the cpp file. So how should I handle them?
Thanks
Edit
This question was marked as possible duplicate. Well, I don't agree with it. That question is talking about why the template functions have to be defined in the header files (I already know that, read the last section of my original post). My question is talking about the inline/dllexport relationship. Keep in mind that (at least I think) I know how inlining and dllexporting works so it's not another "why can't I export inline functions" question.