Standard C++ Library Reference ISO/IEC (VERSION3)
example:
valarray<char> v0("abcdefghijklmnop", 16);
const size_t vi[] = {7, 5, 2, 3, 8};
// v0[valarray<size_t>(vi, 5)] returns
// valarray<char>("hfcdi", 5)
valarray::operator^=
valarray<Ty>& operator^=(const valarray<Ty>& right);
valarray<Ty>& operator^=(const Ty& right);
The member operator replaces each element I of *this with (*this)[I] ^ right[I]. It returns
*this.
valarray::operator|=
valarray<Ty>& operator|=(const valarray<Ty>& right);
valarray<Ty>& operator|=(const Ty& right);
The member operator replaces each element I of *this with (*this)[I] | right[I]. It returns
*this.
valarray::operator~
valarray<Ty> operator~() const;
The member operator returns an object of class valarray<Ty>, of length size(), each of whose
elements I is ~(*this)[I].
valarray::resize
void resize(size_t newsize);
void resize(size_t newsize, const Ty& val);
The member functions both ensure that size() henceforth returns newsize. If it must make the
controlled sequence longer, the first member function appends elements with value Ty(), while the second
member function appends elements with value val. To make the controlled sequence shorter, both member
functions remove and delete elements with subscripts in the range [newsize, size()). Any pointers or
references to elements in the controlled sequence are invalidated.
valarray::shift
valarray<Ty> shift(int count) const;
The member function returns an object of class valarray<Ty>, of length size(), each of whose
elements I is either (*this)[I + count], if I + count is a valid subscript, or Ty(). Thus, if
element zero is taken as the leftmost element, a positive value of count shifts the elements left count
places, with zero fill.