[libc++] Rewrite std::to_address to avoid relying on element_type
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 4 May 2021 22:51:58 +0000 (18:51 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Thu, 6 May 2021 14:14:11 +0000 (10:14 -0400)
commitfe0e86e6026f79e0b18f877196fbddd1d9e140d8
treee0ba34f25a06dae2efb2a6eaf3a5bc46362f6ba8
parentbb113b984565b01355a7f6bb4a5fa2eb8284c2e1
[libc++] Rewrite std::to_address to avoid relying on element_type

This is a rough reapplication of the change that fixed std::to_address
to avoid relying on element_type (da456167). It is somewhat different
because the fix to avoid breaking Clang (which caused it to be reverted
in 347f69c55) was a bit more involved.

Differential Revision: https://reviews.llvm.org/D101638
libcxx/include/__memory/pointer_traits.h
libcxx/include/iterator
libcxx/test/libcxx/utilities/memory/pointer.conversion/to_address.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/memory/pointer.conversion/to_address_std_iterators.pass.cpp [new file with mode: 0644]
libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp
libcxx/test/std/utilities/memory/pointer.conversion/to_address_std_iterators.pass.cpp [new file with mode: 0644]