POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 16:18:42 EDT (-0400)
  Re: Object Oriented POV code  
From: Christopher James Huff
Date: 22 Feb 2004 11:59:06
Message: <cjameshuff-EB5744.11594822022004@news.povray.org>
In article <4038aea6$1@news.povray.org>, "Tek" <tek### [at] evilsuperbraincom> 
wrote:

> that person should be dragged out into the street and shot*. So, ON THAT
> PREMISE, if you have decided to write an inline function there will be an
> "overhead of it being a function (i.e. several instructions) rather than a
> simple instruction", by which I mean you have decided to write a function 
> that is more than one instruction.

__normal_iterator& operator++() { ++_M_current; return *this; }

That's the ++ operator for one of the STL iterators. And it does make 
sense to do it this way...other operators have to do more complex 
things, but it still makes sense to have a ++ operator.


> What I'm saying is, quite simply, we like to make a distinction 
> between "+" and any more elaborate function. Because doing so 
> prevents people writing lines like a = b + 3*(c-d), which looks 
> perfectly innocent, but could be a major bottleneck.

All the coder has to do is look at the types being worked on. And this 
still isn't an argument against the existance of operator overoading.


> We like the clunkier syntax *because* it is harder to use and requires more
> thought from the programmer. In our situation this is a good thing.

But it requires more thought about the wrong things...I don't see how it 
can help.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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