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.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[unique.ptr]77% match -
[smartptr]73% match -
[util.smartptr.getdeleter]65% match -
[inout.ptr]40% match -
[out.ptr]40% match