Abstract
C++ templates use the same source code for different types. This can improve code flexibility and make programs easier to maintain because code can be written and tested once, yet used with different types. Templates can also be used in generic programming that treats different types with the same semantics. This chapter introduces templates and static polymorphism, the STL, template metaprogramming and some generic programming methods, and shows how these can be used effectively for microcontrollers.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
B. Eckel, Thinking in C++ Volume 2: Practical Programming (Pearson Prentice Hall, Upper Saddle River, 2004)
N.M. Josuttis, The C++ Standard Library: A Tutorial and Reference, 2nd edn. (Addison-Wesley, Boston, 2011)
D. Vandevoorde, N.M. Josuttis, C++ Templates: The Complete Guide (Addison-Wesley, Boston, 2003)
Wikipedia, ASCII (2017), http://en.wikipedia.org/wiki/ASCII
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer-Verlag GmbH Germany, part of Springer Nature
About this chapter
Cite this chapter
Kormanyos, C. (2018). C++ Templates for Microcontrollers. In: Real-Time C++. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-56718-0_5
Download citation
DOI: https://doi.org/10.1007/978-3-662-56718-0_5
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-662-56717-3
Online ISBN: 978-3-662-56718-0
eBook Packages: Computer ScienceComputer Science (R0)