John Goche wrote:
I have been going through several header source files which define
classes with inline functions. In the case where the inline functions
are not defined in place, the inline functions from all classes within
the header file are included via a separate file, at the end of the
file, with a directive of the form:
#include <foo.inl>
Could anyone explain what the reason could be for separating the
inline functions into a separate file in this way?
A possible reason is that the authors want to keep open the posibility to
drop the inlines and separately compile the implementation of the files,
and they want to be able to make the change with a minimal edition.
They can have guidelines, or automated documentation tools, that considers
that all the contents of header files is public API, and the .inl are not.
They can want to separate the #include required for the class declaration
from those used by the implemantation, and consider that the separation in
two files is the clearer way to do it.
The reason can simply be "In this company we do it that way from some years
ago, nobody remember the rationale and nobody want to take the work to redo
the style guides".
To know the real reason in each case, you must ask the authors.
--
Salu2