POV-Ray : Newsgroups : povray.general : pov source gcc3 problem : Re: pov source gcc3 problem Server Time
6 Aug 2024 02:22:19 EDT (-0400)
  Re: pov source gcc3 problem  
From: Christopher James Huff
Date: 7 Aug 2002 16:26:57
Message: <chrishuff-FDB661.15170007082002@netplex.aussie.org>
In article <3d517fdb@news.povray.org>,
 "Pandora" <pan### [at] pandora-softwarecom> wrote:

> >   Wrong. For example if you call a function to get the value of the
> > parameter, eg. max(function1(), function2()), the compiler can't optimize
> > that double call away unless it can inline the function in question.
> 
>     Easily solved by doing :
> 
> a=function1();
> b=function2();
> c=max(a,b);

So something that looks like a function can't be used like one. That is 
not a solution, it is a workaround. Plus, it requires two temporary 
variables and three lines of code instead of one simple line.


> >   Using the template solution fixes all problems.
> 
>     Only if you have a compiler that allows you to use templates.

If you don't have one, get one.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

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