POV-Ray : Newsgroups : povray.general : CSDL 0.5 (alpha 5) released : Re: CSDL 0.5 (alpha 5) released Server Time
6 Aug 2024 17:00:02 EDT (-0400)
  Re: CSDL 0.5 (alpha 5) released  
From: Christopher James Huff
Date: 7 Apr 2002 17:37:26
Message: <chrishuff-22A3FE.17385507042002@netplex.aussie.org>
In article <3cb0b59f@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   Or maybe they are using another implementation of the STL library than
> the one which comes by default with gcc (there are many implementations,
> some of them in some ways better than the gcc implementation).

The header has comments from Hewlet Packard and Silicon Graphics, and I 
found this in the header file:

  // "at" will eventually have range checking, once we have the
  // infrastructure to be able to throw stl range errors.
  reference at(size_type n) { return (*this)[n]; }
  const_reference at(size_type n) const { return (*this)[n]; }

Looks like someone hacked it in temporarily. There are other comments 
about differences between the SGI version and the standard...that's 
probably why.
Apple's moving to gcc 3.1, they probably aren't going to put much effort 
into the old libraries.


>   After all, if you are completely sure you will never index out of 
> boundaries, using the at() method is useless overhead.

In one of the cases, it was just a leftover from a previous design. In 
the other cases, I don't know about the bounds...I'll have to do the 
checking myself.


>   Besides, when you use the at() method, you should catch the exception it
> might throw. Do you do that? If not, then using at() is pretty useless. :)

Not quite useless...the uncaught exception would terminate the program 
and the debugger would show where it came from. I'm still working on 
error checking, the next version will use exceptions.

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