Changes to C++98 Containers
C++11 brings three main changes to the container class methods.
First, the addition of rvalue references makes it possible to provide move semantics (Chapter 18, “Visiting with the New C++ Standard”) for containers. Accordingly, the STL now provides move constructors and move assignment operators for containers. These methods take an rvalue reference argument.
Second, the addition of the initializer_list template class (Chapter 18) has led to constructors and assignment operators that accept an initializer_list argument. This makes code like the following possible:
vector<int> vi{100, 99, 97, 98};vi = {96, 99, 94, 95, 102};
Third, the addition of variadic templates and function parameter packs (Chapter 18) makes emplacement ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access