Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81597 - trunk/boost/graph/detail
From: jewillco_at_[hidden]
Date: 2012-11-27 17:11:58


Author: jewillco
Date: 2012-11-27 17:11:57 EST (Tue, 27 Nov 2012)
New Revision: 81597
URL: http://svn.boost.org/trac/boost/changeset/81597

Log:
Added assertions and cast on property map value
Text files modified:
   trunk/boost/graph/detail/d_ary_heap.hpp | 5 ++++-
   1 files changed, 4 insertions(+), 1 deletions(-)

Modified: trunk/boost/graph/detail/d_ary_heap.hpp
==============================================================================
--- trunk/boost/graph/detail/d_ary_heap.hpp (original)
+++ trunk/boost/graph/detail/d_ary_heap.hpp 2012-11-27 17:11:57 EST (Tue, 27 Nov 2012)
@@ -126,18 +126,21 @@
     }
 
     Value& top() {
+ assert (!this->empty());
       return data[0];
     }
 
     const Value& top() const {
+ assert (!this->empty());
       return data[0];
     }
 
     void pop() {
+ assert (!this->empty());
       put(index_in_heap, data[0], (size_type)(-1));
       if (data.size() != 1) {
         data[0] = data.back();
- put(index_in_heap, data[0], 0);
+ put(index_in_heap, data[0], (size_type)(0));
         data.pop_back();
         preserve_heap_property_down();
         verify_heap();


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