W
werwer
How do C++ programmers build sentinel, what I'd call an
"error frame" (in this case), stuctures? It's a great
way to parse, error process, and avoid 'if' depth. Since
C++ doesn't have a break/continue LABEL I can't see
anyother way than to use a goto. This is no big deal in
Java or Perl, but C++ guys seem adverse to idea. How would
you do something like this?
status = FAIL;
ERROR_FRAME: for(; {
for(...;...;...) {
if(..) {
goto LEAVE_PROGRAM;
}
}
if (bad) {
goto LEAVE_PROGRAM;
}
status = OK;
goto LEAVE_PROGRAM;
}
LEAVE_PROGRAM: return status
"error frame" (in this case), stuctures? It's a great
way to parse, error process, and avoid 'if' depth. Since
C++ doesn't have a break/continue LABEL I can't see
anyother way than to use a goto. This is no big deal in
Java or Perl, but C++ guys seem adverse to idea. How would
you do something like this?
status = FAIL;
ERROR_FRAME: for(; {
for(...;...;...) {
if(..) {
goto LEAVE_PROGRAM;
}
}
if (bad) {
goto LEAVE_PROGRAM;
}
status = OK;
goto LEAVE_PROGRAM;
}
LEAVE_PROGRAM: return status