As C++11 has a lot of libraries, it is often not so easy to find the convenient one for each use case.
Utilities are libraries which have a general focus and therefore can be applied in many contexts.
Calculating the Minimum and Maximum
Other utilities are std::function and std::bind. With
std::bind you can easily create new functions from existing ones. In order to bind them to a variable and invoke them later, you have
The reference wrappers
std::cref are pretty handy. One can use them to create a reference wrapper for a variable, which for
std::cref is const.
Of course, the highlights of the utilities are the smart pointers. They allow explicit automatic memory management in C++. You can model the concept of explicit ownership with
std::unique_ptr and model shared ownership with
std::shared_ptr uses reference counting for taking care of its resource. The third one,
std::weak_ptr, helps to break the cyclic dependencies among
std::shared_ptrs, the classic problem of reference counting.
The type traits library is used to check, compare and manipulate type information at compile time.
The time library is an important addition of the new multithreading capabilities of C++. But it is also quite handy to make performance measurements.
Values of Datatypes
Now, let’s talk about the components of the C++ Standard Library.