Abstract
Some data types will be as much a part of your daily vocabulary as basic types such as int or double. You’ll use them everywhere, all the time: in your function signatures, in your algorithms, as member variables of your classes (see later), etc. We call such types vocabulary types. In modern C++, they are one of the cornerstones of understandable, maintainable, and safe code.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Other such vocabulary types include std::variant<>, which replaces union types, and std::any, which replaces void* pointers. Because you’ll use these less frequently, we’ll leave these for you to discover as self-study later on. But don’t worry: once you know std::optional<>, figuring out how to use std::variant<> and std::any should be a walk in the park.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2020 Ivor Horton and Peter Van Weert
About this chapter
Cite this chapter
Horton, I., Van Weert, P. (2020). Vocabulary Types. In: Beginning C++20. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5884-2_9
Download citation
DOI: https://doi.org/10.1007/978-1-4842-5884-2_9
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-5883-5
Online ISBN: 978-1-4842-5884-2
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)