Boost logo

Boost :

From: Vladimir Sykora (vsykora_at_[hidden])
Date: 2007-01-02 15:36:14


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.
Can you check that?

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
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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