This is the mail archive of the
mailing list for the GCC project.
Re: On inlining in C++
- From: Joe Buck <jbuck at synopsys dot com>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: gcc at gcc dot gnu dot org, gdr at integrable-solutions dot net, mrs at apple dot com
- Date: Wed, 6 Aug 2003 12:49:10 -0700
- Subject: Re: On inlining in C++
- References: <20030806185620.4E834F2A45@nile.gnat.com>
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.