Skip to content

Commit

Permalink
Correctly returning *this in operator= for all iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlaine committed Jul 7, 2020
1 parent 552f6fd commit c50ec80
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions native/src/seal/util/iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ namespace seal

SeqIter(const self_type &copy) = default;

inline self_type &operator=(const self_type &assign) = default;
self_type &operator=(const self_type &assign) = default;

SEAL_NODISCARD inline reference operator*() const noexcept
{
Expand Down Expand Up @@ -977,10 +977,11 @@ namespace seal
{}

template <typename S>
self_type &operator=(const StrideIter<S *> &assign)
inline self_type &operator=(const StrideIter<S *> &assign)
{
ptr_it_ = assign;
step_size_ = assign.stride();
return *this;
}

SEAL_NODISCARD inline reference operator*() const noexcept
Expand Down Expand Up @@ -1155,10 +1156,11 @@ namespace seal
{}

template <typename S>
self_type &operator=(const StrideIter<S *> &assign)
inline self_type &operator=(const StrideIter<S *> &assign)
{
ptr_it_ = assign;
step_size_ = assign.stride();
return *this;
}

SEAL_NODISCARD inline reference operator*() const noexcept
Expand Down

0 comments on commit c50ec80

Please sign in to comment.