|
![](/i/fill.gif) |
In article <403814c4$1@news.povray.org>, "Tek" <tek### [at] evilsuperbrain com>
wrote:
> Well, I know a good argument against it. So good in fact that it's the reason
> why every games programmer I know doesn't use operator overloading: It hides
> processing.
So do functions.
> i.e. when you compile a+b, you expect it to compile to a simple add
> instruction,
If I'm adding things that the processor can add.
> and these days most processors can do vector maths so I'd certainly support
> it being used for them.
And that could be done, as well.
> The problem is if you've defined your own type of data that has a "+"
> function, you incur the cost of a function call invisibly in your
> code.
No I don't. I'd have to call that function anyway, so there is precisely
zero overhead. Even if I was wrapping numeric types that the processor
could work on directly, the compiler would inline the code, getting rid
of the function call.
> Of course, for less speed critical stuff like describing POV scenes, I'd
> wholeheartedly support it. But I'm just saying there *is* a good argument
> against it.
I still haven't heard one yet.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |