Boost logo

Boost :

From: Vladimir Sykora (vsykora_at_[hidden])
Date: 2007-01-04 07:47:01


thanks Doug.
Also something that bugs me is that:

        typedef adjacency_list<...> G;
        G g;
        const G& cg = g;
        G f;
        boost::copy_graph(boost::make_filtered_graph(cg, ...), f);

copy_graph() doesn't work if make_filtered_graph() is called with a
const graph.

        boost::copy_graph(boost::make_filtered_graph(g, ...), f);

works fine.

gcc gives an error during casting to (const G&)
in the get() function for filtered_graph<>
(filtered_graph.hpp line 440). I'm not sure why is so, but definitely
should work with a const Graph.
Can you check this?

thanks,

--vjs

Douglas Gregor wrote:
> > On Tue, 2006-11-28 at 10:34 +0000, Vladimir Sykora wrote:
>> >> Can anyone correct the make_filtered_graph() function on
>> >> boost/graph/filtered_graph.hpp to accept a const Graph& ?
> >
> > So, you can pass a temporary to make_filtered_graph? Yeah, that should
> > work. I'll add an overload.
> >
> > The intent of the current approach is to keep the cv-qualification of
> > the graph that's passed in.
> >
> > adjacency_list<...> g;
> >
> > foo(make_filtered_graph(g, ...)); // filtered_graph of non-const g
> >
> > const adjacency_list<...>& gc = g;
> > foo(make_filtered_graph(gc, ...)); // filtered_graph of const g
> >
> > Cheers,
> > Doug
> >
> >


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk