Abstract
This section explains move(), move_if_noexcept(), forward(), swap(), and exchange(). In passing, we also introduce the concepts of move semantics and perfect forwarding.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
unique() is deprecated in C++17 and removed in C++20.
- 2.
The old ptr_fun(), mem_fun(), mem_fun_ref(), bind1st(), bind2nd(), their return types, as well as the base classes unary_function and binary_function that were defined in <functional> have been removed from the C++17 version of the standard.
- 3.
type_info is a structure containing information about a given type. It is explained under “Type Utilities” later in this chapter. For now it suffices to know that you can call name() on a type_info instance to get the full name of a given type. It requires the <typeinfo> header.
- 4.
As we explain later, the actual output of std::type_info::name() depends on your compiler. With Microsoft Visual Studio 2017, for instance, the output for the type const char* is "char const * __ptr64"; with GCC 9 it is "PKc" (a mangled type name, short for "Pointer to Konst char")).
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Peter Van Weert and Marc Gregoire
About this chapter
Cite this chapter
Van Weert, P., Gregoire, M. (2019). General Utilities. In: C++17 Standard Library Quick Reference. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4923-9_2
Download citation
DOI: https://doi.org/10.1007/978-1-4842-4923-9_2
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-4922-2
Online ISBN: 978-1-4842-4923-9
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books