Hi Terry,

Thanks for the suggestion, but the boost::get statement seems to work fine.
The error occurs in the call to connected_components on the last line.
The compiler output is

m:\Code\Replace_NewWaveProp\Boost\boost\property_map.hpp(349) : error C2678: binary '+' : no operator found which takes a left-hand operand of type 'const std::vector<_Ty>::iterator' (or there is no acceptable conversion)
        with
        [
            _Ty=boost::default_color_type
        ]
        m:\Code\Replace_NewWaveProp\Boost\boost\property_map.hpp(349) : while compiling class-template member function 'boost::default_color_type boost::iterator_property_map<RandomAccessIterator,IndexMap,T,R>::operator [](boost::iterator_property_map<RandomAccessIterator,IndexMap,T,R>::key_type) const'
        with
        [
            RandomAccessIterator=std::vector<boost::default_color_type>::iterator,
            IndexMap=boost::detail::choose_pmap_helper<boost::property_value<boost::bgl_named_params<boost::detail::components_recorder<ComponentPropertyMap>,boost::graph_visitor_t,boost::no_property>,boost::vertex_index_t>::type,Graph,boost::vertex_index_t>::const_result_type,
            T=boost::default_color_type,
            R=boost::default_color_type &
        ]
        m:\Code\Replace_NewWaveProp\Boost\boost\graph\depth_first_search.hpp(250) : see reference to class template instantiation 'boost::iterator_property_map<RandomAccessIterator,IndexMap,T,R>' being compiled
        with
        [
            RandomAccessIterator=std::vector<boost::default_color_type>::iterator,
            IndexMap=boost::detail::choose_pmap_helper<boost::property_value<boost::bgl_named_params<boost::detail::components_recorder<ComponentPropertyMap>,boost::graph_visitor_t,boost::no_property>,boost::vertex_index_t>::type,Graph,boost::vertex_index_t>::const_result_type,
            T=boost::default_color_type,
            R=boost::default_color_type &
        ]
        m:\Code\Replace_NewWaveProp\Boost\boost\graph\depth_first_search.hpp(332) : see reference to function template instantiation 'void boost::detail::dfs_dispatch<boost::detail::error_property_not_found>::apply<VertexListGraph,boost::detail::choose_param_helper<boost::detail::error_property_not_found>::result<Default>::type,boost::detail::choose_param_helper<Param>::result<boost::dfs_visitor<>>::type,boost::detail::components_recorder<ComponentsMap>,boost::graph_visitor_t,boost::no_property>(const VertexListGraph &,DFSVisitor,Vertex,const boost::bgl_named_params<T,T
ag,Base> &,boost::detail::error_property_not_found)' being compiled
        with
        [
            VertexListGraph=Graph,
            Default=std::allocator<boost::detail::adj_list_gen<boost::adjacency_list<boost::setS,boost::setS,boost::undirectedS,VertexComponentProperty>,boost::setS,boost::setS,boost::undirectedS,boost::detail::retag_property_list<boost::vertex_bundle_t,VertexComponentProperty>::type,boost::detail::retag_property_list<boost::edge_bundle_t,boost::no_property>::type,boost::no_property,boost::listS>::config::vertex_ptr >::value_type ,
            Param=boost::property_value<boost::bgl_named_params<boost::detail::components_recorder<ComponentPropertyMap>,boost::graph_visitor_t,boost::no_property>,boost::graph_visitor_t>::type,
            ComponentsMap=ComponentPropertyMap,
            DFSVisitor=boost::detail::choose_param_helper<boost::property_value<boost::bgl_named_params<boost::detail::components_recorder<ComponentPropertyMap>,boost::graph_visitor_t,boost::no_property>,boost::graph_visitor_t>::type>::result<boost::dfs_visitor<>>::type,
            Vertex=boost::detail::choose_param_helper<boost::detail::error_property_not_found>::result<std::allocator<boost::detail::adj_list_gen<boost::adjacency_list<boost::setS,boost::setS,boost::undirectedS,VertexComponentProperty>,boost::setS,boost::setS,boost::undirectedS,boost::detail::retag_property_list<boost::vertex_bundle_t,VertexComponentProperty>::type,boost::detail::retag_property_list<boost::edge_bundle_t,boost::no_property>::type,boost::no_property,boost::listS>::config::vertex_ptr >::value_type >::type,
            T=boost::detail::components_recorder<ComponentPropertyMap>,
            Tag=boost::graph_visitor_t,
            Base=boost::no_property
        ]
        m:\Code\Replace_NewWaveProp\Boost\boost\graph\connected_components.hpp(93) : see reference to function template instantiation 'void boost::depth_first_search<Graph,boost::detail::components_recorder<ComponentsMap>,boost::graph_visitor_t,boost::no_property>(const VertexListGraph
&,const boost::bgl_named_params<T,Tag,Base> &)' being compiled
        with
        [
            Graph=Graph,
            ComponentsMap=ComponentPropertyMap,
            VertexListGraph=Graph,
            T=boost::detail::components_recorder<ComponentPropertyMap>,
            Tag=boost::graph_visitor_t,
            Base=boost::no_property
        ]
        TestBoost.cpp(29) : see reference to function template instantiation 'boost::property_traits<PA>::value_type boost::connected_components<Graph,ComponentPropertyMap>(const Graph &,ComponentMap)' being compiled
        with
        [
            PA=ComponentPropertyMap,
            Graph=Graph,
            ComponentMap=ComponentPropertyMap
        ]


----- Original Message ----
From: Stephen Torri <storri@torri.org>
To: boost-users@lists.boost.org
Sent: Friday, April 13, 2007 2:41:44 PM
Subject: Re: [Boost-users] BGL: need help with connected_components and boost::setS

On Fri, 2007-04-13 at 04:50 -0700, Maarten Nieber wrote:
>     Graph g;
>     ComponentPropertyMap vertexToComponent = boost::get(component_t(),
> g);
>
>     // THIS LINE DOES NOT COMPILE. No problem if boost::vecS is used
> instead of boost::setS in the Graph typedef!
>     connected_components(g, vertexToComponent);
> }

I believe you do not want the () after the word component_t. In my
examples I do not have

                boost::property_map<Graph_Base::Graph_t, boost::vertex_name_t>::type clist
                    = boost::get(boost::vertex_name, m_graph);

I think you want the line to read:

    Graph g;
    ComponentPropertyMap vertexToComponent = boost::get(component_t, g);

Stephen

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users



Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos.