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

From: stuart macgregor <stuart.191_at_ntlworld.com>
Date: 17 Sep 2003 16:16:33 -0400


I understand most optimisers will not code up blocks which are known at compile time not to execute.

Should this behaviour be extended in some future standard to complete ignoring of the unreachable code? Perhaps restricted to {if, else, switch, case}?

e.g.

if(0)
{

this is not syntax checked
}
else
{

// compiled code
}

This should allow much shorter and clearer implimentation of much current messy templated traits code.

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
Received on Wed Sep 17 2003 - 13:16:33 PDT

Click to report inappropriate content