From Jason Turner
Watch on YouTube

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.

Resources

Tags