POV-Ray : Newsgroups : povray.tools.general : tga->df3 Server Time
17 May 2024 07:21:21 EDT (-0400)
  tga->df3 (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Ross
Subject: Re: tga->df3
Date: 5 Oct 2004 10:58:44
Message: <4162b6a4$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:41629234@news.povray.org...
> Ross <rli### [at] everestkcnet> wrote:
> > besides being required in order to have the compiler consider inlining
it?
>
>   Quite ironically, most compilers completely ignore the 'inline' keyword
> when they evaluate whether a function is worth inlining or not. That is,
> the 'inline' keyword has usually no effect whatsoever on the probability
> of a function being inlined.
>   In this context 'inline' is exactly as obsolete as eg. 'register' (which
> compilers completely ignore).
>
>   However, unlike 'register', 'inline' is an essential keyword, but for a
> rather different reason than inlining.
>
>   When you declare a function 'inline', you are telling the compiler
> "if the implementation of this function appears in more than one object
> file, the linker must merge them to one".
>
>   Normally if the implementation of a certain function appears in two
> different object files being linked to the same binary, the linker will
> issue an error message: The linker can't know which one of them to use.
>   However, if you had declared the functions 'inline', the compiler will
> instruct the linker that both implementations are actually the same and
> the linker will then use one of them.


Ah, this is actually covered in Scott Meyers book "Effective C++". It's a
good book, but it takes a few reads, atleast for me, and a few projects to
have things stick. This was the first project i've done since reading the
book.


Post a reply to this message

From: Warp
Subject: Re: tga->df3
Date: 5 Oct 2004 11:12:59
Message: <4162b9fa@news.povray.org>
Ross <rli### [at] everestkcnet> wrote:
> Ah, this is actually covered in Scott Meyers book "Effective C++". It's a
> good book

  It certainly is. I also recommend part 2: "More Effective C++".

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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