[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to separate the implementation of inline functions?
From: |
google |
Subject: |
Re: how to separate the implementation of inline functions? |
Date: |
24 Sep 2004 04:53:21 -0700 |
User-agent: |
G2/0.2 |
Guy Harrison wrote:
/.../
>
> struct foo {
> /*inline*/ void bar(int&x) {++x;}
> };
>
> ...generates the same code reguardless of inline commented out or not
That'll be because C++ is *supposed* to inline functions defined within
a class declaration - the "inline" keyword is redundant in the above
code.
> - it's
> "-O" that's the trigger (there may be a specific flag, I've not
bothered to
> look).
But, as has been remarked, it's up to the compiler, ultimately, what it
chooses to inline.
Cheers,
--
Lionel B