Zusammenfassung
In C++ werden Templates, die in Funktions- und Klassentemplates eingeteilt werden können, sehr häufig verwendet. Ein Zeugnis hierfür ist die Standard Template Library, die fast ausschließlich aus templatebasiertem Quellcode besteht.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Moderne Compiler optimieren die Funktion power gleich gut, egal ob die Berechnung innerhalb einer Schleife oder mit einer Rekursion erfolgt.
- 2.
Die Microsoft Compiler bis Visual C++ 2013 unterstützen constexpr nicht.
Literatur
Stroustrup, Bjarne, und Andrew Sutton. 2012. A concept design for C++. http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/A-Concept-Design-for-C-. Zugegriffen am 31.05.2013.
Sutter, Herb. 2001. Why not specialize function templates? 2001, Bd. C/C++ Users Journal 7(19): 65–68.
Veldhuizen, Todd. 1995. Using C++ template metaprograms. C++ Report. 7(4): 36–43.
Unruh, Erwin. 2013. Temple Metaprogrammierung.http://www.erwin-unruh.de/meta.html. Zugegriffen am 05.04.2013.
Krzysztof, Czarnecki, und Ulrich W Eisenecker. 2000. Generative programming. Boston: Addision-Westley. ISBN 0-201-30977-7.
Alexandrescu, Andrej. 2012. Variadic templates are Funadic. http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Variadic-Templates-are-Funadic. Zugegriffen am 16.08.2013.
Krzemieński, Andrzej. 2015. Andrzej’s C++ blog, parsing strings at compile-time — Part I. https://akrzemi1.wordpress.com/2011/05/11/parsing-strings-at-compile-time-part-i/. Zugegriffen am 05.06.2015.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2016 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Lemke, J. (2016). Templates. In: C++-Metaprogrammierung . Xpert.press. Springer Vieweg, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-48550-7_3
Download citation
DOI: https://doi.org/10.1007/978-3-662-48550-7_3
Published:
Publisher Name: Springer Vieweg, Berlin, Heidelberg
Print ISBN: 978-3-662-48549-1
Online ISBN: 978-3-662-48550-7
eBook Packages: Computer Science and Engineering (German Language)