Summary
This episode explores std::to_address, a new utility coming in C++20 that extracts the underlying raw pointer from smart pointers and pointer-like objects. Jason demonstrates how this function works with unique_ptr, raw pointers, and even container iterators, showing its usefulness in generic code that needs access to the memory address regardless of the pointer type. The episode also highlights some interesting implementation details and design decisions in the standard library.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[unique.ptr]75% match -
[smartptr]71% match -
[iterator.concept.contiguous]40% match