Passing user defined visitor for breadth_first_search

Hi, I am using the boost graph (adjacency_list) and want to perform BFS on that. I am constructing the graph, passing VertexProperty as a structure (bundled_properties). When I try to modify the structure in my own bfs visitior (in the overriden function discover_vertex), the compiler says the structure (representing the vertex property) is readonly. I had to switch to const_cast of that structure, but it is not elegant. Can anyone help me through this? Regards, Sourabh

Sourabh wrote:
I am using the boost graph (adjacency_list) and want to perform BFS on that. I am constructing the graph, passing VertexProperty as a structure (bundled_properties). When I try to modify the structure in my own bfs visitior (in the overriden function discover_vertex), the compiler says the structure (representing the vertex property) is readonly. I had to switch to const_cast of that structure, but it is not elegant.
Can anyone help me through this?
Unfortunately, I don't know of any approach better than the const_cast. - Doug
participants (2)
-
Douglas Gregor
-
Sourabh