Skip to main content

Vocabulary Types

  • Chapter
  • First Online:
Beginning C++20
  • 3126 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 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

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Ivor Horton and Peter Van Weert

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics