Re: could if/else avoid syntax checking compile time unreachable code?

From: Ed Avis <ed_at_membled.com>
Date: 21 Sep 2003 14:54:58 -0400


As others have pointed out, the unreachable code has to be syntax checked. But it might not need to be typechecked or checked for names that are in scope (calls to nonexistent functions, etc).

However it would be too confusing if the normal 'if' started to not give errors for code that the compiler considers unreachable (and different compilers will have different levels of intelligence on that). Better to have a separate 'cif' (compile-time if) where the condition must be a compile-time expression.

-- 
Ed Avis <ed_at_membled.com>



[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Received on Sun Sep 21 2003 - 11:54:58 PDT

Click to report inappropriate content