Your idea designs an idiom on how to let ranges handle exceptions. My PR is about how to handle exceptions thrown by ranges. Both sort-of do the same thing but at different points. Your design idiom needs source access (needs to be programmed in). Mine can be bolted on later (an additional element in the range chain). Of course fixing an erroneous range might be tricky but than exception handling and recovering is not easy to being with.

Back to your problem: If you do the foreach by hand, can you place the part that throws (popFront, front or empty) in an try catch block and still iterate to the next element afterwards?

Reply via email to