Boost logo

Boost Users :

Subject: [Boost-users] [BGL] Can't set non-const edge_descriptor = const edge_descriptor
From: John Robertson (jrobertson7711_at_[hidden])
Date: 2010-09-04 00:56:49


I have struct edge_properties { Traits::edge_descriptor ePredecessor; } some_function ( const Graph g ) { e = edge(vertex_a, vertex_b, g).first; //fails here g[e].ePredecessor = e; } compiler gives ./Includes/Utilities.cpp:451: error: passing ‘const boost::detail::edge_desc_impl<boost::bidirectional_tag, long unsigned int>’ as ‘this’ argument of ‘boost::detail::edge_desc_impl<boost::bidirectional_tag, long unsigned int>& boost::detail::edge_desc_impl<boost::bidirectional_tag, long unsigned int>::operator=(const boost::detail::edge_desc_impl<boost::bidirectional_tag, long unsigned int>&)’ discards qualifiers make: *** [pl] Error 1 My guess is that e is returned as a const but g[e].ePredecessor is declared a variable. How can I fix this? Thanks John



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