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::operator [](boost::iterator_property_map::key_type) const'
with
[
RandomAccessIterator=std::vectorboost::default_color_type::iterator,
IndexMap=boost::detail::choose_pmap_helper,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' being compiled
with
[
RandomAccessIterator=std::vectorboost::default_color_type::iterator,
IndexMap=boost::detail::choose_pmap_helper,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_dispatchboost::detail::error_property_not_found::applyboost::detail::error_property_not_found::result<Default>::type,boost::detail::choose_param_helper<Param>::result>::type,boost::detail::components_recorder<ComponentsMap>,boost::graph_visitor_t,boost::no_property>(const VertexListGraph &,DFSVisitor,Vertex,const boost::bgl_named_params &,boost::detail::error_property_not_found)' being compiled
with
[
VertexListGraph=Graph,
Default=std::allocatorboost::setS,boost::setS,boost::undirectedS,VertexComponentProperty,boost::setS,boost::setS,boost::undirectedS,boost::detail::retag_property_listboost::vertex_bundle_t,VertexComponentProperty::type,boost::detail::retag_property_listboost::edge_bundle_t,boost::no_property::type,boost::no_property,boost::listS>::config::vertex_ptr >::value_type ,
Param=boost::property_value,boost::graph_visitor_t>::type,
ComponentsMap=ComponentPropertyMap,
DFSVisitor=boost::detail::choose_param_helper,boost::graph_visitor_t>::type>::result>::type,
Vertex=boost::detail::choose_param_helperboost::detail::error_property_not_found::resultboost::setS,boost::setS,boost::undirectedS,VertexComponentProperty,boost::setS,boost::setS,boost::undirectedS,boost::detail::retag_property_listboost::vertex_bundle_t,VertexComponentProperty::type,boost::detail::retag_property_listboost::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(const VertexListGraph
&,const boost::bgl_named_params &)' 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(const Graph &,ComponentMap)' being compiled
with
[
PA=ComponentPropertyMap,
Graph=Graph,
ComponentMap=ComponentPropertyMap
]
----- Original Message ----
From: Stephen Torri
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::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
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com