Whar are C++ Template strength and weekness 5 items

Showing Answers 1 - 3 of 3 Answers

puneet83

  • Mar 30th, 2009
 

Templates are best used when the logic applied on a data is independent of the data type. eg. performing Swap of 2 data items, these data items can be of type in, double, class objects etc.

But the operations to be performed on different data type is different its better to go for function overloading rather than templates.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions