I would be very grateful if someone could help me to understand header and definitions files.
A colleague told me that definitions should never be included in a header file, but I also read that template and inline functions should be included. Is this true? If so, is there anything else that should be defined in a header file?
If template and inline functions should be included in a header file, then should that result in class header files that contain definitions for template and inline functions, but only declarations for other functions? Or when there is a template/inline function present, or a template class, should all definitions be included in the header file?
Also, if template and inline functions should be included in a header file, doesn't this make it difficult to distribute code without giving away definitions? How do people deal with this when using templates/inlines?
Thank you for any help.