-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert change to reindex_edge_list
.
#269
Conversation
Revert change to `reindex_edge_list`. See boostorg#268 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to keep the for loop and remove the increments if you correctly update after the erease
{ | ||
if (ei->get_target() > u) | ||
{ | ||
typename EdgeList::value_type ce = *ei; | ||
++ei; | ||
el.erase(ce); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
el.erase(ce); | |
ei = el.erase(ce); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. It indeed looks like a better approach; however, I was not able to get this code to compile:
#include <boost/graph/adjacency_list.hpp>
using Graph = boost::adjacency_list<boost::setS, boost::vecS, boost::undirectedS>;
int main() {
Graph g(3);
boost::add_edge(2, 0, g);
boost::remove_vertex(1, g);
}
The gist of the error is that erase
does not return an iterator in this case, but a long unsigned int
.
(The original patch was simply a reversion of a previous commit.)
Could you please add the example from the bug report that can trigger this segfault as a new unit test? |
Yes, I will do. |
I have added the unit test to |
I think the location is fine. Is there a reason that you can't use the existing I know that we're primarily testing for a segfault, but it looks weird in a test if there is no accompanying assertion, so please add in a BOOST_TEST for i) the expected number of vertices and ii) edges after calling Thank you!! |
Looks great, thanks. As soon as the CI is fixed, I'll merge this. |
Please update to the latest changes on |
Done. Still seems to be one build failure (looks unrelated) ...? |
Yeah, that is strange and annoying. |
Might be a real issue with Boost.Filesystem, let's see: boostorg/filesystem#227 |
The simplest way I know to re-run the CI is to close the PR and open it again! |
Hmmm, that didn't work as I expected. |
A couple of issues have been fixed so I think if you merge develop now, you should get a green build. |
Done: seems good now! |
Awesome! In the future, I think it's good to refer to the commit that you're reverting (I put it in the merge commit), so that people can easily track the history. |
Fixes #268 .