mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 23:49:22 +08:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user