Is there a way to get VS2008 to stop warning me about unreachable code?

前端 未结 8 1924
我在风中等你
我在风中等你 2021-02-05 02:04

I have a few config options in my application along the lines of

const bool ExecuteThis=true;
const bool ExecuteThat=false;

and then code that

8条回答
  •  梦谈多话
    2021-02-05 02:11

    What about using preprocessor statements instead?

    #if ExecuteThis
        DoThis();
    #endif
    
    #if ExecuteThat
        DoThat();
    #endif
    

提交回复
热议问题