Boost logo

Boost Users :

Subject: [Boost-users] Compile error when using breadth_first_search with these adjacency_list template parameters
From: Julian (jpellico_at_[hidden])
Date: 2009-05-08 14:45:47


Hi,

I get one compiler error when using breadth_first search with the adjacency
list shown below.

template < typename Vertex>
class bfs_reachable_set_visitor : public default_bfs_visitor {
public:
    bfs_reachable_set_visitor(set<Vertex>* bucket): m_set(bucket) { }
    template < typename Graph >
    void discover_vertex(Vertex u, const Graph & g)
    {
        m_set->insert(u);
    }
    set<Vertex>* m_set;
};

typedef adjacency_list<setS, listS, undirectedS, RectGraphVertexData>
RectAreaGraph;
typedef graph_traits<RectAreaGraph>::vertex_descriptor VDescriptor;
struct RectGraphVertexData {};

void some_func() {
    RectAreaGraph g;
    set<VDescriptor> reachableSet;

    bfs_reachable_set_visitor<VDescriptor> setvis(&reachableSet);

    breadth_first_search(g,
                         *(vertices(g).first),
                         visitor(setvis));

}

The error:
/Developer/boost_1_39_0/boost/property_map.hpp:351: error: no match for
'operator+' in '((const
boost::iterator_property_map<__gnu_cxx::__normal_iterator<boost::default_color_type*,
std::vector<boost::default_color_type,
std::allocator<boost::default_color_type> > >,
boost::adj_list_vertex_property_map<boost::adjacency_list<boost::setS,
boost::listS, boost::undirectedS, RectGraphVertexData, boost::no_property,
boost::no_property, boost::listS>, boost::detail::error_property_not_found,
const boost::detail::error_property_not_found&, boost::vertex_index_t>,
boost::default_color_type,
boost::default_color_type&>*)this)->boost::iterator_property_map<__gnu_cxx::__normal_iterator<boost::default_color_type*,
std::vector<boost::default_color_type,
std::allocator<boost::default_color_type> > >,
boost::adj_list_vertex_property_map<boost::adjacency_list<boost::setS,
boost::listS, boost::undirectedS, RectGraphVertexData, boost::no_property,
boost::no_property, boost::listS>, boost::detail::error_property_not_found,
const boost::detail::error_property_not_found&, boost::vertex_index_t>,
boost::default_color_type, boost::default_color_type&>::iter + boost::get
[with PropertyMap =
boost::adj_list_vertex_property_map<boost::adjacency_list<boost::setS,
boost::listS, boost::undirectedS, RectGraphVertexData, boost::no_property,
boost::no_property, boost::listS>, boost::detail::error_property_not_found,
const boost::detail::error_property_not_found&, boost::vertex_index_t>,
Reference = const boost::detail::error_property_not_found&, K =
void*](((const boost::put_get_helper<const
boost::detail::error_property_not_found&,
boost::adj_list_vertex_property_map<boost::adjacency_list<boost::setS,
boost::listS, boost::undirectedS, RectGraphVertexData, boost::no_property,
boost::no_property, boost::listS>, boost::detail::error_property_not_found,
const boost::detail::error_property_not_found&, boost::vertex_index_t>
>&)((const boost::put_get_helper<const
boost::detail::error_property_not_found&,
boost::adj_list_vertex_property_map<boost::adjacency_list<boost::setS,
boost::listS, boost::undirectedS, RectGraphVertexData, boost::no_property,
boost::no_property, boost::listS>, boost::detail::error_property_not_found,
const boost::detail::error_property_not_found&, boost::vertex_index_t>
>*)(&((const
boost::iterator_property_map<__gnu_cxx::__normal_iterator<boost::default_color_type*,
std::vector<boost::default_color_type,
std::allocator<boost::default_color_type> > >,
boost::adj_list_vertex_property_map<boost::adjacency_list<boost::setS,
boost::listS, boost::undirectedS, RectGraphVertexData, boost::no_property,
boost::no_property, boost::listS>, boost::detail::error_property_not_found,
const boost::detail::error_property_not_found&, boost::vertex_index_t>,
boost::default_color_type,
boost::default_color_type&>*)this)->boost::iterator_property_map<__gnu_cxx::__normal_iterator<boost::default_color_type*,
std::vector<boost::default_color_type,
std::allocator<boost::default_color_type> > >,
boost::adj_list_vertex_property_map<boost::adjacency_list<boost::setS,
boost::listS, boost::undirectedS, RectGraphVertexData, boost::no_property,
boost::no_property, boost::listS>, boost::detail::error_property_not_found,
const boost::detail::error_property_not_found&, boost::vertex_index_t>,
boost::default_color_type, boost::default_color_type&>::index))), ((void*
const&)((void* const*)(& v))))'

For now, since it compiles with vecS, I can change to that, but I would
prefer to have setS for edge and listS for vertex.



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