The following is what I got from Wikipedia
Advantages and disadvantages
==========================
Some uses of templates, such as the max() function, were previously
filled by function-like preprocessor macros (a legacy of the C
programming language). For example, here is a possible max() macro:
#define max(a,b) ((a) < (b) ? (b) : (a))
Both macros and templates are expanded at compile time. Macros are
always expanded inline; templates can also be expanded as inline
functions when the compiler deems it appropriate. Thus both
function-like macros and function templates have no run-time overhead.
However, templates are generally considered an improvement over macros
for these purposes. Templates are type-safe. Templates avoid some of
the common errors found in code that makes heavy use of function-like
macros. Perhaps most importantly, templates were designed to be
applicable to much larger problems than macros.
There are three primary drawbacks to the use of templates: compiler
support, poor error messages, and code bloat. Many compilers
historically have very poor support for templates, so the use of
templates can make code somewhat less portable. Support may also be
poor when a C++ compiler is being used with a linker which is not
C++-aware, or when attempting to use templates across shared library
boundaries. Most modern compilers though now have fairly robust and
standard template support.
Almost all compilers produce confusing, long, or sometimes unhelpful
error messages when errors are detected in code that uses templates.
This can make templates difficult to develop.
Finally, the use of a templates 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. However, judicious use of template specialization can
dramatically reduce such code bloat in some cases. The extra
instantiations generated by templates can also cause debuggers to have
difficulty working gracefully with templates. For example, setting a
debug breakpoint within a template from a source file may either miss
setting the breakpoint in the actual instantiation desired or may set a
breakpoint in every place the template is instantiated.