title: Dll export or inline
body: <p>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.</p>
  
  <p>Inline case:</p>
  
  <ul>
  <li>faster code (simple getters and setters)</li>
  <li>require recompiling when modifying the implementation</li>
  <li>implementation has to be in the header</li>
  <li>can't "hide" the implementation</li>
  </ul>
  
  <p>Export case:</p>
  
  <ul>
  <li>possibly slower code because of the stack push/pop and call cost</li>
  <li>recompile just the specific object</li>
  <li>implementation is "hidden"</li>
  </ul>
  
  <p>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?</p>
  
  <p>Thanks</p>
  
  <p><strong>Edit</strong></p>
  
  <p>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.</p>