This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Running C++ TEMPLATE code on ti hardware



I want to make my code generic and want to run on  ti hardware  (any family)

I want to use template to change the data type of input array like uint8 or uint 32 or uint16 .

But I read somewhere that template is not good option on hardware .

One reason I know that, I have to write SIMD for each data type .

Is there any other reason behind "NOT TO WRITE TEMPLATE IN EMBEDDED CODE" 

  • If you're careful about how you write the template classes, there should be no overhead to using templates. It's not really fair to blame templates themselves. Writing efficient C++ code is beyond the scope of this forum, but there are good books on the topic.
    What you really want to watch out for are the object-oriented features like polymorphism (virtual methods), which can add a pretty high overhead.