Refactoring with C++ 11

前端 未结 11 2369
夕颜
夕颜 2020-11-28 18:17

Given the new toolset provided by c++ lots of programmers, aiming at code simplification, expressiveness, efficiency, skim through their old code and make tweaks (some point

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 18:43

    Use of override keyword

    Mark virtual functions in derived classes as override (if they indeed override of course). This can protect against introducing bugs in the future, e.g. by changing the signature of a virtual function in a base class and forgetting to change the signature in all derived classes accordingly.

提交回复
热议问题