|
|
"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
|
|
|
|
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
|
|