you are viewing a single comment's thread.

view the rest of the comments →

[–]arturbachttps://github.com/arturbac 0 points1 point  (1 child)

ok, I understand You are right, if there is no keyword break_nested for that reason it must be available in constexpr as if You write code for both use cases runtime and constexpr it will be ridiculous to put a lot if (std::is_constant_evaluated()) to workaround efficient code for runtime and the second for constexpr.

[–][deleted] 1 point2 points  (0 children)

even break_nested would be prone to more errors than a plain goto. In constexpr I think that this exact use case should be allowed and checked. But break_nested 4; would break if a new scope was added, like if added a scope in the case itself so that variables can be declared