]> www.ginac.de Git - ginac.git/commit
G_eval: fix incorrect use of STL iterator.
authorAlexei Sheplyakov <varg@metalica.kh.ua>
Sat, 8 Aug 2009 10:02:47 +0000 (13:02 +0300)
committerJens Vollinga <jensv@nikhef.nl>
Sun, 9 Aug 2009 20:08:30 +0000 (22:08 +0200)
commitdda45abd8a2c408f8b3eb7959a10dfb2468ecc3a
tree2d4644cd279ba75a5a4fa5567ac776bf0a9aed35
parent619879b5bd86a99334affe1f05d17616cc2c1898
G_eval: fix incorrect use of STL iterator.

According to [lib.bidirectional.iterators] it's not OK to decrement
an iterator pointing to the beginning of the sequence. Fortunately random
access iterators provided by (current versions of) gcc/libstdc++ don't have
this silly limitation, so the code which works with pointers works with
iterators without any changes at all. However,
 - there's no guarantee that the current behavior won't change in the future
 - some non-GNU compilers are not that smart (i.e. the program segfaults
   upon when decrementing beginning-of-the-sequence iterator).
ginac/inifcns_nstdsums.cpp