Boost logo

Boost Users :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2005-09-06 15:35:47


On Aug 15, 2005, at 3:58 PM, Tiago de Paula Peixoto wrote:
> I have one more problem with filtered_graph, but this time it has to do
> with bundled properties. If I try to compile the following program:
>
> --------------------------------------------------------------
> #include <boost/graph/adjacency_list.hpp>
> #include <boost/graph/filtered_graph.hpp>
>
> using namespace boost;
>
> struct VertexProperties
> {
> int answer;
> };
>
>
> int main()
> {
> typedef adjacency_list<vecS,vecS,bidirectionalS,VertexProperties>
> graph_t;
> typedef filtered_graph<graph_t,keep_all> f_graph_t;
> graph_t g;
> f_graph_t fg(g, keep_all());
> graph_traits<f_graph_t>::vertex_descriptor v = add_vertex(g);
> fg[v].answer = 42;
> return 0;
> }
> --------------------------------------------------------------
> I get the following error with boost 1.33 and GCC 4.0.1:
> [snip]
> This was supposed to work right? The error is pretty clear, but I don't
> know what "local_to_global" is supposed to do, and where it should be.

Yes, it should have worked.

> I made the attached modifications to a local version of
> filtered_graph.hpp, and the code above compiles, but I don't think that
> they are right at all, since I changed the constness of the internal
> reference to the original graph.

I think we're better off using const_cast instead of changing the
stored reference. I've fixed the problem in CVS and the fix will be
part of the upcoming 1.33.1 release. Thanks for reporting the bug!

        Doug


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