help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does order of inline function definitions matter?


From: Maett
Subject: Re: Does order of inline function definitions matter?
Date: Sat, 01 Jul 2006 11:28:39 +0200
User-agent: Opera Mail/9.00 (Win32)

Mike wrote:

> I am wondering if I need to define my inline functions in the correct
> order to get the full benefits of inlining.  In the following code,
> will g++ inline the function b() within a()?
>
> inline void a ()
> {
>     b();
> }
>
> inline void b ()
> {
>     do_something();
> }
>
> Or do I need to reorder them in the source file?

Just try and see.
Call g++ with "-S" and your favourite optimizing switches and inspect
the generated assembler file.

Maett


reply via email to

[Prev in Thread] Current Thread [Next in Thread]