recompile after base class change

前端 未结 3 721
忘掉有多难
忘掉有多难 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:20

    Formally, if you don't recompile you're violating the One Definition Rule, and get undefined behavior.

    Practically, as long as the member function you modify hasn't been inlined anywhere, and you aren't changing the signature, you probably retain binary compatibility. On most platforms. If you're lucky, your platform documentation provides such a guarantee.

提交回复
热议问题