https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416

Glen Joseph Fernandes <glenjofe at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |glenjofe at gmail dot com

--- Comment #6 from Glen Joseph Fernandes <glenjofe at gmail dot com> ---
> Do we then have a spec bug?

The to_address(const P&) overload always assumed a valid pointer_traits<P>.
Even before it was std::to_address in C++20, when it was __to_address in
libstdc++, or boost::to_address, or __to_raw_pointer in libc++, and was used in
C++11 and above, its return type was 'typename
std::pointer_traits<P>::element_type*' which requires a valid pointer_traits.

i.e. Our allocator-aware containers would only ever work with fancy pointer P
for which pointer_traits<P> is valid.

std::to_address being used for more than just raw-or-fancy-pointers came later
(since Casey's P1474 which chose to use it for contiguous iterators). My guess
is they didn't realize pointer_traits<I> wouldn't be valid for those iterator
types.

Reply via email to