AI Applications in C++: How costly are virtual functions? What are the possible optimizations?

前端 未结 15 1273
慢半拍i
慢半拍i 2020-12-23 12:43

In an AI application I am writing in C++,

  1. there is not much numerical computation
  2. there are lot of structures for which run-time polymorphism is ne
15条回答
  •  情话喂你
    2020-12-23 13:20

    You can implement polymorfism in runtime using virtual functions and in compile time by using templates. You can replace virtual functions with templates. Take a look at this article for more information - http://www.codeproject.com/KB/cpp/SimulationofVirtualFunc.aspx

提交回复
热议问题