From Jason Turner
Watch on YouTube

Summary

This episode explores C++20's new std::shift_left and std::shift_right algorithms, which provide a standardized way to shift elements within containers. Jason explains how these algorithms work and their key behaviors, including how they handle out-of-range shift values and what happens to the vacated positions after shifting. Importantly, he demonstrates that elements shifted out of range are left in a valid but unspecified state, similar to how objects behave after being moved from in standard containers.

Resources

Tags