Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: