[libc++] Make sure std::to_address doesn't depend on P::element_type.
Differential Revision: https://reviews.llvm.org/D101638
NOKEYCHECK=True
GitOrigin-RevId: da456167f56a604810aaeb89d21d3c7047945566
diff --git a/include/iterator b/include/iterator
index 97677fe..95a39e7 100644
--- a/include/iterator
+++ b/include/iterator
@@ -1352,7 +1352,7 @@
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable iterator");
#endif
- return (pointer)_VSTD::addressof(*__i);
+ return _VSTD::__to_address(__i);
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator++() _NOEXCEPT
{