Avoid STL panic at Elevator when compiled with -D_GLIBCXX_DEBUG
authorAlpar Juttner <alpar@cs.elte.hu>
Mon, 17 Nov 2008 15:41:15 +0000
changeset 381b04e431907bc
parent 380 d916b8995e22
child 382 61fbd77f0f44
Avoid STL panic at Elevator when compiled with -D_GLIBCXX_DEBUG
lemon/elevator.h
     1.1 --- a/lemon/elevator.h	Mon Nov 17 15:41:15 2008 +0000
     1.2 +++ b/lemon/elevator.h	Mon Nov 17 15:41:15 2008 +0000
     1.3 @@ -57,7 +57,7 @@
     1.4  
     1.5    private:
     1.6  
     1.7 -    typedef typename std::vector<Item>::iterator Vit;
     1.8 +    typedef Item *Vit;
     1.9      typedef typename ItemSetTraits<Graph,Item>::template Map<Vit>::Type VitMap;
    1.10      typedef typename ItemSetTraits<Graph,Item>::template Map<int>::Type IntMap;
    1.11  
    1.12 @@ -433,10 +433,10 @@
    1.13      void initStart()
    1.14      {
    1.15        _init_lev=0;
    1.16 -      _init_num=_items.begin();
    1.17 -      _first[0]=_items.begin();
    1.18 -      _last_active[0]=_items.begin()-1;
    1.19 -      Vit n=_items.begin();
    1.20 +      _init_num=&_items[0];
    1.21 +      _first[0]=&_items[0];
    1.22 +      _last_active[0]=&_items[0]-1;
    1.23 +      Vit n=&_items[0];
    1.24        for(typename ItemSetTraits<Graph,Item>::ItemIt i(_g);i!=INVALID;++i)
    1.25          {
    1.26            *n=i;
    1.27 @@ -475,8 +475,8 @@
    1.28            _first[_init_lev]=_init_num;
    1.29            _last_active[_init_lev]=_init_num-1;
    1.30          }
    1.31 -      _first[_max_level+1]=_items.begin()+_item_num;
    1.32 -      _last_active[_max_level+1]=_items.begin()+_item_num-1;
    1.33 +      _first[_max_level+1]=&_items[0]+_item_num;
    1.34 +      _last_active[_max_level+1]=&_items[0]+_item_num-1;
    1.35        _highest_active = -1;
    1.36      }
    1.37