POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: A test Server Time
30 Sep 2024 21:33:46 EDT (-0400)
  Re: A test  
From: Invisible
Date: 24 Sep 2008 09:28:39
Message: <48da4087@news.povray.org>
Warp wrote:

>   Whether the compiler will inline a function (from which it has the
> implementation at that point) is unspecified and completely up to the
> compiler. The 'inline' keyword doesn't really matter in this.

Right. So adding an inline function to a header file means that the 
compiler *could* inline it across compilation units (which would 
otherwise be impossible), but ultimately it's up to the compiler to 
decide what it will or won't inline?

I can certainly see why the standard doesn't mandate anything either 
way. Do you happen to know the "typical" behaviour of any well-known C++ 
compilers? (Presumably it varies depending on the optimisation level you 
select...)

>   (Btw, template functions are implicitly 'inline', so the keyword doesn't
> have to be used with them.)

That makes sense.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.