void A() {
B();
if (true) return;
...
C();
D();
}
Here is what I am doing now. Is there a simple " exit;" or " return;" that will not give an error "unreachable code"without using if?
Just to make it clear: it if (true) return; works (with the warning "Dead code", which I do not like and can suppress)!
if I just use return; only then I get an error "unreachable code".
Note. The simple “This cannot be done without use if” is also an acceptable answer provided by the link.
kobik source
share