This quick reference is a condensed reference guide to the essential data structures, algorithms, and functions provided by the C++ Standard Library. Used by millions of C++ programmers on a daily basis, the C++ Standard Library features core classes for strings, I/O streams, and various generic containers, as well as a comprehensive set of algorithms to manipulate them. In recent years, the C++11 and C++14 standards have added even more efficient container classes, a new powerful regular expression library, and a portable multithreading library featuring threads, mutexes, condition variables, and atomic variables.
Needless to say, it is hard to know and remember all the possibilities, details, and intricacies of this vast and growing library. This handy reference guide is therefore indispensable to any C++ programmer. It offers a condensed, well-structured summary of all essential aspects of the C++ Standard Library. No page-long, repetitive examples or obscure, rarely used features. Instead, everything you need to know and watch out for in practice is outlined in a compact, to-the-point style, interspersed with practical tips and well-chosen, clarifying examples. The book does not explain the C++ language or syntax, but is accessible to anyone with basic C++ knowledge or programming experience. Even the most experienced C++ programmer though will learn a thing or two from it and find it a useful memory-aid. Among the topics covered are:
The essentials that the C++ Standard Library has to offer
How to use containers to efficiently store and retrieve your data
How to use algorithms to inspect and manipulate your data
How lambda expressions allow for elegant use of algorithms
What the standard string class provides and how to use it
How to write localized applications
What functionality the library provides for file and stream-based I/O
What smart pointers are and how to use them to prevent memory leaks
How to write safe and efficient multi-threaded code using the C++11 threading libraries
Author(s): Peter Van Weert; Marc Gregoire
Publisher: Apress
Year: 2016
Language: English
Pages: 211
Contents at a Glance
Contents
About the Authors
About the Technical Reviewer
Introduction
Chapter 1: Numerics and Math
Common Mathematical Functions
Basic Functions
Exponential and Logarithmic Functions
Power Functions
Trigonometric and Hyperbolic Functions
Error and Gamma Functions
Integral Rounding of Floating-Point Numbers
Floating-Point Manipulation Functions
Classification and Comparison Functions
Error Handling
Fixed-Width Integer Types
Arithmetic Type Properties
Complex Numbers
Compile-Time Rational Numbers
Random Numbers
Random Number Generators
Pseudorandom Number Engines
Engine Adaptors
Predefined Engines
Non-Deterministic Random Number Generator
Seeding
Random Number Distributions
Uniform Distributions
Bernoulli Distributions
Normal Distributions
Poisson Distributions
Sampling Distributions
Discrete Distribution
Piecewise Constant Distribution
Piecewise Linear Distribution
Example
Numeric Arrays
std::slice
std::gslice
std::mask_array
std::indirect_array
Chapter 2: General Utilities
Moving, Forwarding, Swapping
Moving
Forwarding
Swapping
Pairs and Tuples
Pairs
Tuples
Relational Operators
Smart Pointers
Exclusive-Ownership Pointers
std::unique_ptr
std::auto_ptr
Shared-Ownership Pointers
std::shared_ptr
std::weak_ptr
Function Objects
Reference Wrappers
Predefined Functors
Generic Function Wrappers
Binding Function Arguments
Functors for Class Members
Initializer Lists
Date and Time Utilities
Durations
Time Points
Clocks
C-style Date and Time Utilities
C-Style File Utilities
Type Utilities
Runtime Type Identification ,
Type Traits
Type Classification
Type Properties
Type Property Queries
Type Comparisons
Type Transformations
Chapter 3: Containers
Iterators
Iterator Tags
Non-Member Functions to Get Iterators
Non-Member Operations on Iterators
Sequential Containers
std::vector
Construction
Iterators
Accessing Elements
Adding Elements
Size and Capacity
Removing Elements
Remove-Erase Idiom
std::vector
Complexity
std::deque
Complexity
std::array
Complexity
std::list and std::forward_list ,
Complexity
List-Specific Algorithms
Sequential Containers Reference
Iterators
Size and Capacity
Access
Modifiers
Non-Member Functions
std::bitset
Complexity
Reference
Access
Operations
Container Adaptors
std::queue
std::priority_queue
std::stack
Example
Reference
Ordered Associative Containers
std::map and std::multimap