Skip to content

Commit

Permalink
Merge pull request #861 from JordanMaples/dev/jomaples/lwg3320
Browse files Browse the repository at this point in the history
implement LWG3320
  • Loading branch information
JordanMaples committed Apr 15, 2020
2 parents 044849d + 9cb376c commit b438556
Show file tree
Hide file tree
Showing 6 changed files with 1,274 additions and 1,536 deletions.
24 changes: 0 additions & 24 deletions include/gsl/span
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,7 @@ public:
using difference_type = std::ptrdiff_t;

using iterator = details::span_iterator<ElementType>;
using const_iterator = details::span_iterator<const ElementType>;
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;

#if defined(GSL_USE_STATIC_CONSTEXPR_WORKAROUND)
static constexpr const size_type extent{Extent};
Expand Down Expand Up @@ -594,31 +592,9 @@ public:
return {data, endData, endData};
}

constexpr const_iterator cbegin() const noexcept
{
const auto data = storage_.data();
return {data, data + size(), data};
}

constexpr const_iterator cend() const noexcept
{
const auto data = storage_.data();
const auto endData = data + storage_.size();
return {data, endData, endData};
}

constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator{end()}; }
constexpr reverse_iterator rend() const noexcept { return reverse_iterator{begin()}; }

constexpr const_reverse_iterator crbegin() const noexcept
{
return const_reverse_iterator{cend()};
}
constexpr const_reverse_iterator crend() const noexcept
{
return const_reverse_iterator{cbegin()};
}

#ifdef _MSC_VER
// Tell MSVC how to unwrap spans in range-based-for
constexpr pointer _Unchecked_begin() const noexcept { return data(); }
Expand Down

0 comments on commit b438556

Please sign in to comment.