From 9d13cb14c3cf6b59bd16071929f25ac5516a4d24 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Fri, 9 Dec 2016 20:19:50 -0800 Subject: [PATCH] Fixes to typedef's for span::const_iterator. * Don't const-qualify span::const_iterator's value_type Fixes Microsoft/GSL#434 --- gsl/span | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gsl/span b/gsl/span index 6d6992d..aec826a 100644 --- a/gsl/span +++ b/gsl/span @@ -140,15 +140,15 @@ namespace details template class span_iterator { + using element_type_ = typename Span::element_type; public: using iterator_category = std::random_access_iterator_tag; - using value_type = - std::conditional_t, - typename Span::element_type>; + using value_type = std::remove_const_t; using difference_type = typename Span::index_type; - using pointer = std::add_pointer_t; - using reference = std::add_lvalue_reference_t; + using reference = + std::conditional_t &; + using pointer = std::add_pointer_t; constexpr span_iterator() noexcept : span_iterator(nullptr, 0) {}