By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,852 Members | 2,219 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,852 IT Pros & Developers. It's quick & easy.

Extension .inl

P: n/a
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.
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Dave" <be***********@yahoo.com> wrote in message
news:10*************@news.supernews.com
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.

Microsoft uses it for its MFC and ATL libraries. This alone is about enough
to make it qualify as "common practice".
--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)

Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.