Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/GSL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Henze <34543625+beinhaerter@users.noreply.github.com>2022-08-18 22:28:11 +0300
committerGitHub <noreply@github.com>2022-08-18 22:28:11 +0300
commit10df83d292bf5bbdc487e57dc8c2dc8c7a01f4d1 (patch)
treea9efc7b930c7f4710e6d2bbe073b41921b64bcae
parent2e94541fcfe0c33e8536469110d3b19f156bc6f9 (diff)
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.
-rw-r--r--include/gsl/span14
1 files 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 <class Type>
-struct std::pointer_traits<::gsl::details::span_iterator<Type>> {
- using pointer = ::gsl::details::span_iterator<Type>;
- using element_type = Type;
+struct pointer_traits<::gsl::details::span_iterator<Type>>
+{
+ using pointer = ::gsl::details::span_iterator<Type>;
+ 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 <std::size_t Ext>