& params) { if (num_vertices(g) == 0) return 0; typedef typename graph_traits::vertex_descriptor Vertex; function_requires< WritablePropertyMapConcept >(); typedef typename boost::graph_traits::directed_category directed; BOOST_STATIC_ASSERT((boost::is_same::value)); typedef typename property_traits::value_type comp_type; // c_count initialized to "nil" (with nil represented by (max)()) comp_type c_count((std::numeric_limits::max)()); detail::components_recorder vis(c, c_count); depth_first_search(g, params.visitor(vis)); return c_count + 1; } template inline typename property_traits::value_type connected_components(const Graph& g, ComponentMap c) { if (num_vertices(g) == 0) return 0; typedef typename graph_traits::vertex_descriptor Vertex; function_requires< WritablePropertyMapConcept >(); typedef typename boost::graph_traits::directed_category directed; BOOST_STATIC_ASSERT((boost::is_same::value)); typedef typename property_traits::value_type comp_type; // c_count initialized to "nil" (with nil represented by (max)()) comp_type c_count((std::numeric_limits::max)()); detail::components_recorder vis(c, c_count); depth_first_search(g, visitor(vis)); return c_count + 1; } } // namespace boost #endif // BOOST_GRAPH_CONNECTED_COMPONENTS_HPP