In order to solve this problem I have, I wrote this little piece of code:
for (std::list<std::vector<int>>::iterator i = l.begin(); i != l.end(); ++i) {
for (std::list<std::vector<int>>::iterator j = next(i, 1); j != l.end(); ++j) {
if (includes((*j).begin(), (*j).end(), (*i).begin(), (*i).end())) {
l.erase(j++);
}
}
}
The basic idea is, given an element of the list, to remove elements from the rest of the list that matches some criteria (in this case, a containment relation).
Executing this triggers a segmentation fault, which I can't understand. Can anyone give me a clue about this?