Performance hit from C++ style casts?

前端 未结 7 776
半阙折子戏
半阙折子戏 2020-12-04 09:19

I am new to C++ style casts and I am worried that using C++ style casts will ruin the performance of my application because I have a real-time-critical dead

相关标签:
7条回答
  • 2020-12-04 10:00

    When using dynamic_cast several checks are made during runtime to prevent you from doing something stupid (more at the GCC mailing list), the cost of one dynamic_cast depends on how many classes are affected, what classes are affected, etc.
    If you're really sure the cast is safe, you can still use reinterpret_cast.

    0 讨论(0)
提交回复
热议问题