3 ms·
It seems like it should be possible to factor out most of the iterator boilerplate into a helper class. Then each place where you want to iterate you can const
by abbeyj 1y ago
It seems like it should be possible to factor out most of the iterator boilerplate into a helper class. Then each place where you want to iterate you can construct an instance of that helper class and supply a lambda that specifies how to descend into children. If you're doing the same iteration in several places then you can use a named function instead of a lambda, which means less typing for each `for` loop. Here's a rough sketch: https://godbolt.org/z/x94WY77rv https://godbolt.org/z/x94WY77rv