From Jason Turner
Watch on YouTube

Summary

This episode explores C++23's new std::out_ptr and std::inout_ptr utilities, designed to simplify interaction between C++ smart pointers and C APIs that use pointer-to-pointer parameters. Jason demonstrates how these utilities create temporary proxy objects that automatically update smart pointers when the C function modifies raw pointers. He highlights a key safety consideration: the need to ensure that the smart pointer's deleter matches the memory allocation method used by the C function.

Resources

Tags