solve span compile problem with gcc 5.5.0 (#1052)

GCC 4.8.0 - 7.0 has a bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480) involving specialization in a namespace enclosing the specialized template. This PR fixes an appearance of this bug in the span header.
This commit is contained in:
Werner Henze 2022-08-18 21:28:11 +02:00 committed by GitHub
parent 2e94541fcf
commit 10df83d292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -343,16 +343,18 @@ namespace details
}; };
}} // namespace gsl::details }} // namespace gsl::details
namespace std
{
template <class Type> template <class Type>
struct std::pointer_traits<::gsl::details::span_iterator<Type>> { struct pointer_traits<::gsl::details::span_iterator<Type>>
{
using pointer = ::gsl::details::span_iterator<Type>; using pointer = ::gsl::details::span_iterator<Type>;
using element_type = Type; using element_type = Type;
using difference_type = ptrdiff_t; using difference_type = ptrdiff_t;
static constexpr element_type* to_address(const pointer i) noexcept { static constexpr element_type* to_address(const pointer i) noexcept { return i.current_; }
return i.current_;
}
}; };
} // namespace std
namespace gsl { namespace details { namespace gsl { namespace details {
template <std::size_t Ext> template <std::size_t Ext>