|
From: | E. Robert Tisdale |
Subject: | Re: how to separate the implementation of inline functions? |
Date: | Fri, 17 Sep 2004 19:23:07 -0700 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 |
Sean McManus wrote:
g++ won't let me separate the implementation of inline functions(i.e. not in the class declaration) -- it says the inlined function is not defined.What's up?
The inline function definition *must* be included somehow in the translation unit where they are to be inline'd. This means that you can't separate the interface from the implementation. The inline function definitions *must* be public! You can't hide them. Some programmers put inline function definitions in a separate file (a footer file) from the class definition file (a header file) then include the footer file at the foot of the header file.
[Prev in Thread] | Current Thread | [Next in Thread] |