Is there any reason to use C instead of C++ for embedded development?

后端 未结 30 3644
既然无缘
既然无缘 2020-11-30 17:20

Question

I have two compilers on my hardware C++ and C89

I\'m thinking about using C++ with classes but without polymorphism (to avoid vtables). The main r

30条回答
  •  渐次进展
    2020-11-30 17:57

    I've written some code for ARM7 embedded paltform on IAR Workbench. I highly recommend relying on templates to do compile-time optimization and path prediction. Avoid dynamic casting like plague. Use traits/policies to your advantage, as prescribed in Andrei Alexandrescu's book, Modern C++ design.

    I know, it can be hard to learn, but I am also sure that your product will benefit from this approach.

提交回复
热议问题