To reduce indentation in my code I want to skip a if statement if a condition is met. Let this be the following code:
if (foo()) {
if (bar()) if_continue; // continue the code and dont execute buz()
buz();
}
...¹
The normal continue
does not work.
And I also cant use return
because code at [¹] should still be executed.
I also want to avoid a solution like this, because this would result in unwanted indentation:
if (foo()) {
if (!bar()) {
...
}
}
Is this possible in C++?