1.Historically, some compilers exhibited poor support for templates. So, the use of templates could decrease code portability.
2.Many compilers lack clear instructions when they detect a template definition error. This can increase the effort of developing templates, and has prompted the development of Concepts for possible inclusion in a future C++ standard.
3.Since the compiler generates additional code for each template type, indiscriminate use of templates can lead to code bloat, resulting in larger executables.
4.Because a template by its nature exposes its implementation, injudicious use in large systems can lead to longer build times.
5.It can be difficult to debug code that is developed using templates. Since the compiler replaces the templates, it becomes difficult for the debugger to locate the code at runtime.
6.Templates of Templates (nesting) are not supported by all compilers, or might have a max nesting level.
7.Templates are in the headers, which require a complete rebuild of all project pieces when changes are made.
8.No information hiding. All code is exposed in the header file. No one library can solely contain the code.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment