Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49576 - trunk/boost/numeric/ublas
From: guwi17_at_[hidden]
Date: 2008-11-03 17:07:27


Author: guwi17
Date: 2008-11-03 17:07:27 EST (Mon, 03 Nov 2008)
New Revision: 49576
URL: http://svn.boost.org/trac/boost/changeset/49576

Log:
- fix and close #2422
- the exception was caused when trying to erase an empty range
- now erase(it1, it2) does nothing if it1 == it2

Text files modified:
   trunk/boost/numeric/ublas/storage_sparse.hpp | 1 +
   1 files changed, 1 insertions(+), 0 deletions(-)

Modified: trunk/boost/numeric/ublas/storage_sparse.hpp
==============================================================================
--- trunk/boost/numeric/ublas/storage_sparse.hpp (original)
+++ trunk/boost/numeric/ublas/storage_sparse.hpp 2008-11-03 17:07:27 EST (Mon, 03 Nov 2008)
@@ -410,6 +410,7 @@
         }
         // BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it.
         void erase (iterator it1, iterator it2) {
+ if (it1 == it2) return /* nothing to erase */;
             BOOST_UBLAS_CHECK (begin () <= it1 && it1 < it2 && it2 <= end (), bad_index ());
             std::copy (it2, end (), it1);
             resize (size () - (it2 - it1));


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk