Static variable initialization over a library

前端 未结 3 806
名媛妹妹
名媛妹妹 2020-12-03 15:58

I am working on a factory that will have types added to them, however, if the class is not explicitly instiated in the .exe that is exectured (compile-time), then the type i

3条回答
  •  北海茫月
    2020-12-03 16:07

    As a general rule of thumb, an application do not include static or global variables from a library unless they are implicitly or explicitly used by the application.

    There are hundred different ways this can be refactored. One method could be to place the static variable inside function, and make sure the function is called.

提交回复
热议问题