Possible Duplicate:
What are the disadvantages of using templates?
Reading about templates I found out that for example if you not use a function from a class template, it will not generate code for that(a positive thing). I also saw that you can use compile time porgramming using templates and implement, let’s say a factorial example and the result will be know at compile time.
So my question is: what are the negative aspects of using templates ?
Thank you.
Compile time. Complex, especially recursive templates can take ages to compile.
Error messages. Template error messages are terrifying and generally not very helpful. Concepts would’ve been great, but sadly the language committee has dropped them from the upcoming standard.
Readability. Templates code can be challenging to read.
Difficulty Much of the underlying tricks rely on not-so-well-known aspects of the language standard, so one needs a decent knowledge of the language to get along with them.