Summary
This episode explains key changes to sequence containers (std::array, std::vector, std::deque, std::forward_list, and std::list) in C++17. The most significant enhancement is that emplace_back() and emplace_front() now return a reference to the newly inserted element, whereas in C++11/14 they returned void. Jason demonstrates how this change simplifies code by allowing direct access to newly created elements without requiring separate lookup operations, making container operations more efficient and readable.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[diff.cpp03.containers]62% match -
[diff.cpp23.containers]62% match -
[diff.cpp20.containers]62% match -
[diff.cpp17.containers]62% match -
[diff.cpp14.containers]61% match -
[deque]40% match -
[forward.list]40% match -
[list]40% match