Name

valarray class template — Array of values

Synopsis

template<typename T>
class valarray {
public:
  typedef T value_type;
   
  valarray(  );
  explicit valarray(size_t);
  valarray(const T&, size_t);
  valarray(const T*, size_t);
  valarray(const valarray&);
  valarray(const slice_array<T>&);
  valarray(const gslice_array<T>&);
  valarray(const mask_array<T>&);
  valarray(const indirect_array<T>&);
  ~valarray(  );
   
  valarray<T>& operator=(const valarray<T>&);
  valarray<T>& operator=(const T&);
  valarray<T>& operator=(const slice_array<T>&);
  valarray<T>& operator=(const gslice_array<T>&);
  valarray<T>& operator=(const mask_array<T>&);
  valarray<T>& operator=(const indirect_array<T>&);
   
  T operator[](size_t) const;
  T& operator[](size_t);
   
  valarray<T> operator[](slice) const;
  slice_array<T> operator[](slice);
  valarray<T> operator[](const gslice&) const;
  gslice_array<T> operator[](const gslice&);
  valarray<T> operator[](const valarray<bool>&) const;
  mask_array<T> operator[](const valarray<bool>&);
  valarray<T> operator[](const valarray<size_t>&) const;
  indirect_array<T> operator[](const valarray<size_t>&);
   
  valarray<T> operator+(  ) const;
  valarray<T> operator-(  ) const;
  valarray<T> operator~(  ) const;
  valarray<bool> operator!(  ) const;
   
  valarray<T>& operator*= (const T&);
  valarray<T>& operator/= (const T&);
  valarray<T>& operator%= (const T&);
  valarray<T>& operator+= (const T&);
  valarray<T>& operator-= (const T&);
  valarray<T>& operator^= (const T&);
  valarray<T>& operator&= (const T&);
  valarray<T>& operator|= (const T&); ...

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.