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

Ion Gaztañaga igaztanaga@gmail.com
Tue Apr 20 19:52:02 GMT 2021


On 20/04/2021 15:36, Jonathan Wakely wrote:
> 
> No, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416
> 
> 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.

Many thanks again!

Ion


More information about the Libstdc++ mailing list