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 are the various types of stl containers?

0 Answers  


how to overload << and >> operator in c++

3 Answers   Wipro,


method overloading means what?

2 Answers   CTS,


i wanted to know about questions about c,c++ , which is required for placements.... im a fresher

0 Answers   NDS,


Distinguish between: a) Normal layout & Print Layout views b) Windows Clipboard & office Clipboard c) Save & Save As Commands d) Program File & Data File e) Pie Charts & Barr Charts

0 Answers  






HOW TO GET "H1B" -VISA 4 USA FOR MY SON?HE HAD COMPLETED "MS"(IT)FROM AUSTALIA 2007.I AM WORKING IN U.S.A.

0 Answers  


what is c++

2 Answers  


What is C++ could you enplane me please?

1 Answers  


What is a stl vector?

0 Answers  


What do stl stand for?

0 Answers  


#define CUBE(x) (x*x*x) main() { int a,b=3; a=cube(b++); printf("%d %d",a,b); } What should be the value of a and b? My calc a=4 but syst a=6 how pls tell me if you know it?

12 Answers   Wipro,


What do you mean by stl?

1 Answers  


Categories