|
![](/i/fill.gif) |
In article <3cb0b59f@news.povray.org>, Warp <war### [at] tag povray org>
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] mac com>
POV-Ray TAG e-mail: chr### [at] tag povray org
TAG web site: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |