Boost logo

Boost Users :

Subject: Re: [Boost-users] Compilation error using boost::filtered_graph when trying to access graph properties via boost::graph_bundle
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-02-28 22:21:33


On Tue, 1 Mar 2011, Tony Cook wrote:

>
> Hi Jeremiah
>
> ** Confirmed fixed :) Thanks **
>
> You might want to look at reverse_graph.hpp as it worked around the problem using:
>
> typename boost::graph_property_type<base_type>::type& operator[](graph_bundle_t)
> { return get_property(*this); }
> typename boost::graph_property_type<base_type>::type const& operator[](graph_bundle_t) const
> { return get_property(*this); }
>
> I adapted this fix approach for my local copy of filtered_graph.hpp like so:
>
> typename Graph::graph_bundled& operator[](graph_bundle_t)
> { return const_cast<Graph&>(this->m_g)[boost::graph_bundle]; }
> typename Graph::graph_bundled const& operator[](graph_bundle_t) const
> { return this->m_g[boost::graph_bundle]; }
>
> But your fix is general so the code in reverse_graph.hpp is most likely redundant now - I've chucked my local patch away.

Thanks for catching that -- I removed the workaround from
reverse_graph.hpp and it still worked.

-- Jeremiah Willcock


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