468,170 Members | 2,103 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,170 developers. It's quick & easy.

inline functions

Let's say I have a function

func()
{

............
func();
..........
}

I.e it is a recursive function. What happens if I declare it inline

Feb 7 '06 #1
3 5178
On 2006-02-07, Aloo <an************@rediffmail.com> wrote:
Let's say I have a function

func()
{

...........
func();
.........
}

I.e it is a recursive function. What happens if I declare it inline


It won't be inlined, or it will only be inlined a certain number of
times.

There is no _requirement_ that the compiler insert inline code at any
given place the function is called.
Feb 7 '06 #2
Aloo wrote:
Let's say I have a function

func()
{

............
func();
..........
}

I.e it is a recursive function. What happens if I declare it inline

inline is more of a hint than an instruction, the compiler is at liberty
to ignore 'inline' where it considers inline to be inappropriate. This
would be one of those cases.

--
Ian Collins.
Feb 7 '06 #3
Aloo wrote:
Let's say I have a [recursive] function.
What happens if I declare it inline


inline is merely a hint to the compiler, and it may be ignored.

On a related note, good optimizing compilers can eliminate some
forms of recursion.
Feb 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by A | last post: by
14 posts views Thread by Chris Mantoulidis | last post: by
47 posts views Thread by Richard Hayden | last post: by
7 posts views Thread by Srini | last post: by
4 posts views Thread by Tony Johansson | last post: by
7 posts views Thread by Alvin | last post: by
43 posts views Thread by Patrick Laurent | last post: by
18 posts views Thread by Method Man | last post: by
12 posts views Thread by sam_cit | last post: by
2 posts views Thread by aaragon | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.