Boost logo

Boost Users :

From: Alex Hagen-Zanker (a.hagen-zanker_at_[hidden])
Date: 2019-07-19 14:06:47

> //not working
> depth_first_search(ee_archi, vis, boost::make_assoc_property_map(vis.vertex_coloring),0);

The visitor is passed to depth_first_search by value, and hence a copy of vis is made and you are then working on two colormaps.

You need to change your visitor to have reference semantics so that a copy of the visitor still points to the same color_map.

This should work:

struct my_vis : default_dfs_visitor {
        using colormap = boost::associative_property_map<std::map<diGraph::vertex_descriptor, default_color_type> >;
        colormap vertex_coloring;

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at