D
Dave
Is it fairly well accepted for the implementation file of a library class or
function template to have a .inl (for inline) extension? Example:
my_library.h:
template <class T>
class problem_solver
{
public:
int solve(const T &problem);
};
#include "my_library.inl"
my_library.inl:
template <class T>
int problem_solver<T>::solve(const T &problem)
{
....
}
Obviously, I could put the implementation directly in the header file. But
in the case where one wants to separate the implementation from the
interface (usually a good idea!), is .inl commonly accepted? I've seen it a
few places and somewhere along the line I picked it up myself (I don't
remember where), but I would like to find out to what extent it is common
practice.
function template to have a .inl (for inline) extension? Example:
my_library.h:
template <class T>
class problem_solver
{
public:
int solve(const T &problem);
};
#include "my_library.inl"
my_library.inl:
template <class T>
int problem_solver<T>::solve(const T &problem)
{
....
}
Obviously, I could put the implementation directly in the header file. But
in the case where one wants to separate the implementation from the
interface (usually a good idea!), is .inl commonly accepted? I've seen it a
few places and somewhere along the line I picked it up myself (I don't
remember where), but I would like to find out to what extent it is common
practice.