What is the disadvantage of templates ?

Answers were Sorted based on User's Feedback



What is the disadvantage of templates ?..

Answer / atul jawale

Disadvantages of templates:

1. Many compilers historically have very poor support for
templates, so the use of templates can make code somewhat
less portable.
2. Almost all compilers produce confusing, unhelpful error
messages when errors are detected in template code. This
can make templates difficult to develop.
3. Each use of a template may cause the compiler to
generate extra code (an instantiation of the template), so
the indiscriminate use of templates can lead to code bloat,
resulting in excessively large executables.

Is This Answer Correct ?    40 Yes 7 No

What is the disadvantage of templates ?..

Answer / ranjit

one disadvantage is non-standards conforming compilers.
templates can also sometimes make maintaining code harder
and less clear, although the exact opposite can be said as
well.
Templates aren't *inherently* code bloating.

Is This Answer Correct ?    14 Yes 15 No

Post New Answer

More STL Interview Questions

What is a stl vector?

0 Answers  


How the STL's are implemented, What the difference between templates and STL?

1 Answers   Symphony,


draw a flowchart that accepts two numbers and checks if the first is divisible by the second.

0 Answers   Appin, NIIT,


what is c++

2 Answers  


What is the Difference between CArray and CList?

1 Answers   ProdEx Technologies, Siemens,






help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase

0 Answers  


what is template and type convertion

0 Answers   TATA,


what is the difference between thread and process

1 Answers   Infosys,


why & sign is used in copy constructor

4 Answers  


When did c++ add stl?

0 Answers  


Write a program in C++ to concatenate two strings into third string using pointers

5 Answers  


what's the difference between function overloading and function overiding?

5 Answers  


Categories