Will #if RELEASE work like #if DEBUG does in C#?

前端 未结 11 1750
时光说笑
时光说笑 2020-11-30 17:39

In all the examples I\'ve seen of the #if compiler directive, they use \"DEBUG\". Can I use \"RELEASE\" in the same way to exclude code that I don\'t want to run when compi

11条回答
  •  眼角桃花
    2020-11-30 17:51

    On my VS install (VS 2008) #if RELEASE does not work. However you could just use #if !DEBUG

    Example:

    #if !DEBUG
    SendTediousEmail()
    #endif
    

提交回复
热议问题