Boost logo

Boost Users :

Subject: [Boost-users] boost::iterator_property_map causes run-time fatal error in debug mode on VS2008
From: Artyom (sneg.vx_at_[hidden])
Date: 2009-05-18 09:37:03


Dear all,

Noticed some strange behaviour in Debug mode today using
boost::iterator_property_map. Not sure whether this is a bug so decided
to post here.

Here is a how property map is instantiated:

    template< class Graph, class Vertex, class Edge, class
VertexIterator, class EdgeIterator > class PathRecorder
    {
       typedef typename boost::property_map< typename Graph,
boost::vertex_index_t >::type VertexId_PMap;
       typedef boost::iterator_property_map< typename std::vector< Edge
>::iterator, VertexId_PMap, typename Edge, typename Edge & > PredEdgeMap;

       /// relevant members
       std::vector< Edge > edges;
       VertexId_PMap vertex_id;

       PathRecorder( void ) : /*** some instantiations here ***/
predEdgeMap( edges.begin(), vertex_id ) { }
     
       /**
       @desc
       Update an entry inside a map ( fatal error happens here )
       **/
       void put( Vertex target, Edge e )
       {
          boost::put( predEdgeMap, target, e );
       }
    }

In Release mode everything works fine but in Debug mode put method
causes a fatal error. It fails in property_map.hpp (351):

inline R operator[](key_type v) const { return *(iter + get(index, v)) ; }

iter seems to be equal to 0... Which is extremely suspicious. Could
anyone think whether I am doing something wrong? I can provide more
information if this isn't enough.

Arty


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net