Why not have all the functions as virtual in C++?

后端 未结 11 1493
逝去的感伤
逝去的感伤 2020-12-12 21:50

I know that virtual functions have an overhead of dereferencing to call a method. But I guess with modern architectural speed it is almost negligible.

  1. Is ther
11条回答
  •  情话喂你
    2020-12-12 22:42

    Java method calls are far more efficient than C++ due to runtime optimization.

    What we need is to compile C++ into bytecode and run it on JVM.

提交回复
热议问题