3.8 KiB
[template.gslice.array]
29 Numerics library [numerics]
29.6 Numeric arrays [numarray]
29.6.7 Class template gslice_array [template.gslice.array]
29.6.7.1 Overview [template.gslice.array.overview]
namespace std {template class gslice_array {public:using value_type = T; void operator= (const valarray&) const; void operator*= (const valarray&) const; void operator/= (const valarray&) const; void operator%= (const valarray&) const; void operator+= (const valarray&) const; void operator-= (const valarray&) const; void operator^= (const valarray&) const; void operator&= (const valarray&) const; void operator|= (const valarray&) const; void operator<<=(const valarray&) const; void operator>>=(const valarray&) const;
gslice_array(const gslice_array&); ~gslice_array(); const gslice_array& operator=(const gslice_array&) const; void operator=(const T&) const;
gslice_array() = delete; // as implied by declaring copy constructor above};}
This template is a helper template used by thegslice subscript operator
gslice_array<T> valarray<T>::operator[](const gslice&);
It has reference semantics to a subset of an array specified by agslice object.
Thus, the expressiona[gslice(1, length, stride)] = b has the effect of assigning the elements ofb to a generalized slice of the elements ina.
29.6.7.2 Assignment [gslice.array.assign]
void operator=(const valarray<T>&) const; const gslice_array& operator=(const gslice_array&) const;
These assignment operators have reference semantics, assigning the values of the argument array elements to selected elements of thevalarray object to which thegslice_array refers.
29.6.7.3 Compound assignment [gslice.array.comp.assign]
void operator*= (const valarray<T>&) const; void operator/= (const valarray<T>&) const; void operator%= (const valarray<T>&) const; void operator+= (const valarray<T>&) const; void operator-= (const valarray<T>&) const; void operator^= (const valarray<T>&) const; void operator&= (const valarray<T>&) const; void operator|= (const valarray<T>&) const; void operator<<=(const valarray<T>&) const; void operator>>=(const valarray<T>&) const;
These compound assignments have reference semantics, applying the indicated operation to the elements of the argument array and selected elements of thevalarray object to which thegslice_array object refers.
29.6.7.4 Fill function [gslice.array.fill]
void operator=(const T&) const;
This function has reference semantics, assigning the value of its argument to the elements of thevalarray object to which thegslice_array object refers.