2
0
mirror of https://github.com/boostorg/graph.git synced 2026-02-28 05:22:24 +00:00

fixed num_vertices(G) == 0 case

[SVN r10826]
This commit is contained in:
Jeremy Siek
2001-08-09 14:37:10 +00:00
parent af8a8a7515
commit cab2ffe94b

View File

@@ -136,7 +136,8 @@ namespace boost {
detail::error_property_not_found)
{
typedef typename graph_traits<Graph>::vertices_size_type size_type;
std::vector<size_type> time_vec(num_vertices(g));
size_type n = num_vertices(g) > 0 ? num_vertices(g) : 1;
std::vector<size_type> time_vec(n);
return strong_components_impl
(g, comp, r_map,
make_iterator_property_map(time_vec.begin(), choose_const_pmap
@@ -165,7 +166,9 @@ namespace boost {
detail::error_property_not_found)
{
typedef typename graph_traits<Graph>::vertex_descriptor Vertex;
std::vector<Vertex> root_vec(num_vertices(g));
typename std::vector<Vertex>::size_type
n = num_vertices(g) > 0 ? num_vertices(g) : 1;
std::vector<Vertex> root_vec(n);
return strong_comp_dispatch2
(g, comp,
make_iterator_property_map(root_vec.begin(), choose_const_pmap