[valarray.unary] # 29 Numerics library [[numerics]](./#numerics) ## 29.6 Numeric arrays [[numarray]](numarray#valarray.unary) ### 29.6.2 Class template valarray [[template.valarray]](template.valarray#valarray.unary) #### 29.6.2.6 Unary operators [valarray.unary] [🔗](#lib:operator+,valarray) `valarray operator+() const; valarray operator-() const; valarray operator~() const; valarray operator!() const; ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L7813) *Mandates*: The indicated operator can be applied to operands of type T and returns a value of type T (bool foroperator!) or which may be unambiguously implicitly converted to typeT (bool for operator!)[.](#1.sentence-1) [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L7820) *Returns*: A valarray whose length is size()[.](#2.sentence-1) Each element of the returned array is initialized with the result of applying the indicated operator to the corresponding element of the array[.](#2.sentence-2)