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
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 981a64c380bea01b35d3426e194c8f8f5f7ec709
diff --git a/include/valarray b/include/valarray
index 3714350..2b94204 100644
--- a/include/valarray
+++ b/include/valarray
@@ -1220,6 +1220,7 @@
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 @@
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>