I'm using boost 1_31_0 and gcc 3.4.2.
I'm adding an iterator interface to my class that abstracts use of
internal boost graph properties and have had success with one exception
that involves const_iterator.
Here is how this class looks:
struct VertexData
{
typedef boost::graph_property_iter_range
::iterator iterator;
typedef boost::graph_property_iter_range
::const_iterator const_iterator;
typedef Vertex_Datum value_type;
VertexData(DataGraphT& dataGraph);
iterator begin(void) {return
boost::get_property_iter_range(dataGraph_,vertex_Datum).first;}
// const_iterator begin(void) const {return
boost::get_property_iter_range(dataGraph_,vertex_Datum).first;}
iterator end(void) {return
boost::get_property_iter_range(dataGraph_,vertex_Datum).second;}
// const_iterator end(void) const {return
boost::get_property_iter_range(dataGraph_,vertex_Datum).second;}
When I uncomment the const begin method, I get the following compilation
error:
dataGraph.h:30: error: conversion from
`boost::detail::lvalue_pmap_iter,
boost::subgraph_global_property_map,
EdgeProperty, boost::no_property, boost::listS>,
boost::adjacency_list,
EdgeProperty, boost::no_property, boost::listS>*, Vertex_Datum,
Vertex_Datum&, vertex_Datum_t> > >' to non-scalar type
`boost::detail::lvalue_pmap_iter,
boost::subgraph_global_property_map,
EdgeProperty, boost::no_property, boost::listS>, const
boost::adjacency_list,
EdgeProperty, boost::no_property, boost::listS>*, Vertex_Datum, const
Vertex_Datum&, vertex_Datum_t> > >' requested
Could somebody point out the problem here?