recompile after base class change

前端 未结 3 719
忘掉有多难
忘掉有多难 2021-01-25 16:15

In particular, the way most C++ implementations work implies that a change in the size of a base class requires a recompilation of all derived classes.

3条回答
  •  天涯浪人
    2021-01-25 17:13

    If it just the implementation, it should work fine. That's whole concept of Windows DLL's. Adding or removing interfaces won't changes the class size (unless you're introducing a new virtual function) but in the large extend the way functions laid out in the memory could be changed. So a recompilation is required if you're making use of the new function. On the other hand, most of the modern compilers are smart enough to identify the relevant changes because of a simple modification in the header files.

提交回复
热议问题