From 10df83d292bf5bbdc487e57dc8c2dc8c7a01f4d1 Mon Sep 17 00:00:00 2001 From: Werner Henze <34543625+beinhaerter@users.noreply.github.com> Date: Thu, 18 Aug 2022 21:28:11 +0200 Subject: [PATCH] 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. --- include/gsl/span | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/gsl/span b/include/gsl/span index 4d5bc7c..49e1502 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -343,16 +343,18 @@ namespace details }; }} // namespace gsl::details +namespace std +{ template -struct std::pointer_traits<::gsl::details::span_iterator> { - using pointer = ::gsl::details::span_iterator; - using element_type = Type; +struct pointer_traits<::gsl::details::span_iterator> +{ + using pointer = ::gsl::details::span_iterator; + using element_type = Type; using difference_type = ptrdiff_t; - static constexpr element_type* to_address(const pointer i) noexcept { - return i.current_; - } + static constexpr element_type* to_address(const pointer i) noexcept { return i.current_; } }; +} // namespace std namespace gsl { namespace details { template