This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: On inlining in C++


On Wed, Aug 06, 2003 at 02:56:20PM -0400, Robert Dewar wrote:
> > Given that we can't inline mutually recursive functions, it is always
> > possible to fix the order so that things work, though it can be a pain
> > in the ass.
> 
> and that can be a bad distortion of the source code for bad reasons!

I've got to produce code that gets by at least four distinct C++
compilers, and pretty much all of them have this issue.  It goes away
with the new unit-at-a-time approach, but for portability programmers
will still need to consider order.

In practice, this problem is not that bad.  Declarations and
definitions are separate.  The declarations, with their documentation,
can appear in their most natural order; definitions might need to be
rearranged.  With a documentation-generating tool such as doxygen, or
a smart source code browser, the position of a given definition in the
source code becomes less of an issue.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]