Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!usc!snorkelwacker!bloom-beacon!bloom-beacon!wesommer From: wesommer@athena.mit.edu (Bill Sommerfeld) Newsgroups: comp.lang.c++ Subject: Re: Inline style question Message-ID: <1990Apr7.175208.19693@athena.mit.edu> Date: 7 Apr 90 20:51:09 GMT References: <154@dumbcat.UUCP> <2428@dataio.Data-IO.COM> Sender: tytso@athena.mit.edu (Theodore Y. Ts'o) Organization: None. Lines: 24 In-Reply-To: bright@Data-IO.COM's message of 4 Apr 90 20:22:10 GMT Certainly a recursive function is inlineable. The simple case: inline int func(i) { return i ? 0 : func(i + 1); } A modified version of this: inline int func(int i) { if (i) return 0; else return func(i+1); } will be inlined as a loop by GCC (since it's tail recursive). - Bill -- The USSR is one of the few places | Bill Sommerfeld at MIT/Project Athena on earth where the currency is | sommerfeld@mit.edu softer than the toilet paper |