On inlining in C++

Joe Buck jbuck@synopsys.com
Wed Aug 6 22:14:00 GMT 2003


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.



More information about the Gcc mailing list