]> 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:29:24 +0000 (22:29 +0200)
commit554722426543a6e1445ead11167107a69fd21af9
treeceab14290118904a7c2bba1534f2b30e6d132b11
parentaa1afbbdb118846cfc266a1d7a8d5188ac214e0e
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).
(cherry picked from commit dda45abd8a2c408f8b3eb7959a10dfb2468ecc3a)
ginac/inifcns_nstdsums.cpp