[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Does order of inline function definitions matter?
From: |
Mike |
Subject: |
Re: Does order of inline function definitions matter? |
Date: |
23 Jul 2006 10:57:45 -0700 |
User-agent: |
G2/0.2 |
It turns out that g++ does need to see the definition of b() in order
to inline it within a(), so you do need to order your inline functions
properly. I came across the -Winline switch which tells you all the
reasons why functions are not being inlined.
Mike
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?
>
> Thanks,
>
> Mike