Will the compiler only compile code that can get executed?

后端 未结 6 2008
梦谈多话
梦谈多话 2020-12-15 03:37

I have a class library and am using only part of it. Is there a need to delete what isn\'t being used in order to shrink the size of the created code (in release configurati

6条回答
  •  无人及你
    2020-12-15 04:05

    It all gets compiled. Regardless of whether it is called or not. The code may be called by an external library.

    The only way to make the compiler ignore code is by using Compiler Preprocessor Directives. More about those here.

提交回复
热议问题