From b404c871ae1970ee0d3d8a636981131ea888d60e Mon Sep 17 00:00:00 2001 From: Sergey Grosman <43882757+Sergey-Grosman@users.noreply.github.com> Date: Tue, 13 Oct 2020 00:22:30 +0200 Subject: [PATCH] you have to allocate the vector, otherwise get a segmentation fault --- boost_properties/in_algorithms.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boost_properties/in_algorithms.cxx b/boost_properties/in_algorithms.cxx index 96b3ce6..6834315 100644 --- a/boost_properties/in_algorithms.cxx +++ b/boost_properties/in_algorithms.cxx @@ -276,7 +276,7 @@ void example3() std::map preds; my_predmap predmap(preds); - std::vector dists; + std::vector dists(boost::num_vertices(G)); my_distmap distmap(G, dists); std::map weights; my_weightmap weightmap(weights);