Add return statement to slice_array and mask_array assignment. Closes PR20614.

This patch just adds the required return statements to slice_array::operator=
and mask_array::operator=.

Tests were added to check that the return value is the same as the object assigned
to.

llvm-svn: 215414
This commit is contained in:
Eric Fiselier
2014-08-12 00:06:58 +00:00
parent e31acf239a
commit 981a64c380
3 changed files with 30 additions and 0 deletions

View File

@@ -1220,6 +1220,7 @@ slice_array<_Tp>::operator=(const slice_array& __sa) const
const value_type* __s = __sa.__vp_;
for (size_t __n = __size_; __n; --__n, __t += __stride_, __s += __sa.__stride_)
*__t = *__s;
return *this;
}
template <class _Tp>
@@ -2090,6 +2091,7 @@ mask_array<_Tp>::operator=(const mask_array& __ma) const
size_t __n = __1d_.size();
for (size_t __i = 0; __i < __n; ++__i)
__vp_[__1d_[__i]] = __ma.__vp_[__1d_[__i]];
return *this;
}
template <class _Tp>