From Jason Turner
Watch on YouTube

Summary

This episode introduces C++23's std::move_only_function, a new feature designed for working with non-copyable callables. Jason demonstrates how traditional std::function requires copyable objects, forcing developers to use shared_ptr when working with unique_ptr or other move-only resources inside lambdas. In contrast, move_only_function specifically supports move-only callables, leading to simpler code and better performance by avoiding unnecessary shared ownership.

Resources

Tags