C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Bringing break/continue with label to C++

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Fri, 20 Dec 2024 11:05:14 +0100
Another way, multi-level breaks could be implemented would be exceptions ... try { for(...) for(...) if(...) throw(std::break<1>()); } catch(std::break<1>()& e) {}; with catches by a templated type with number/name parameter. Argument against it: Exceptions are for exceptional program flow. Breaks could be the standard flow.

Received on 2024-12-20 10:07:28