mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
rewrite operators in iterator to take advantage of nrvo
This commit is contained in:
parent
f4c608fd39
commit
46603698ec
@ -199,7 +199,8 @@ namespace details
|
|||||||
constexpr span_iterator operator+(const difference_type n) const noexcept
|
constexpr span_iterator operator+(const difference_type n) const noexcept
|
||||||
{
|
{
|
||||||
span_iterator ret = *this;
|
span_iterator ret = *this;
|
||||||
return ret += n;
|
ret += n;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
friend constexpr span_iterator operator+(const difference_type n,
|
friend constexpr span_iterator operator+(const difference_type n,
|
||||||
@ -220,7 +221,8 @@ namespace details
|
|||||||
constexpr span_iterator operator-(const difference_type n) const noexcept
|
constexpr span_iterator operator-(const difference_type n) const noexcept
|
||||||
{
|
{
|
||||||
span_iterator ret = *this;
|
span_iterator ret = *this;
|
||||||
return ret -= n;
|
ret -= n;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <
|
||||||
@ -343,8 +345,6 @@ namespace details
|
|||||||
public:
|
public:
|
||||||
using size_type = std::size_t;
|
using size_type = std::size_t;
|
||||||
|
|
||||||
static_assert(Ext != dynamic_extent, "A fixed-size span must not have size == dynamic_extent");
|
|
||||||
|
|
||||||
constexpr extent_type() noexcept = default;
|
constexpr extent_type() noexcept = default;
|
||||||
|
|
||||||
template <size_type Other>
|
template <size_type Other>
|
||||||
|
Loading…
Reference in New Issue
Block a user