Daily bit(e) of C++ | std::to_address
Daily bit(e) of C++ #263, C++20 utility for obtaining the address of pointers and pointer-like objects: std::to_address.
The std::to_address is a simple C++20 utility that provides uniform access to the address from raw and smart pointers (and pointer-like objects) without the need to access the underlying value.
Before this utility was introduced, the most uniform way to obtain the address was using std::addressof(*p), which requires p to point to a valid object.