std::to_address implementation and std::pointer_traits's static_assert

Jonathan Wakely
Tue Apr 20 20:15:04 GMT 2021

On 20/04/21 21:08 +0100, Jonathan Wakely wrote:
>On 20/04/21 21:52 +0200, Ion Gaztañaga wrote:
>>On 20/04/2021 15:36, Jonathan Wakely wrote:
>>>No, see
>>>I consider it a defect in the standard that pointer_traits is not
>>>SFINAE friendly, but that's what the current standard requires.
>>>I hope it will be changed for C++23.
>>Hi Jonathan,
>>Many thanks for your quick and precise reply. And just like Giuseppe 
>>D'Angelo described in the bug comments, I also encountered that 
>>defining both element_type and value_type (which makes MSVC STL 
>>happy, libc++ still not tested) meets LWG3446.
>>So at least for libstdc++ I will specialize std::pointer_traits for 
>>boost::container::vector<>::iterator and will revisit the issue 
>>if/when LWG3446 is applied.
>It's on the gcc-10 branch as r10-9698, which will be in GCC 10.4:
>That also includes the recently approved fix for LWG 3541:

To be clear, it's not been approved by WG21, but LWG voted to move it
to Tentatively Ready a week or so ago. I just haven't updated the
issues list yet, so it's still in "New" status.

More information about the Libstdc++ mailing list