std::valarray::operator+,-,~,!
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
valarray<T> operator+() const; |
(1) | |
valarray<T> operator-() const; |
(2) | |
valarray<T> operator~() const; |
(3) | |
valarray<bool> operator!() const; |
(4) | |
一元运算符应用于数字数组中的每个元素.
原文:
Applies unary operators to each element in the numeric array.
目录 |
[编辑] 参数
(无)
[编辑] 返回值
数字数组包含的元素的值,得到相应的操作员中的值*this.
原文:
A numeric array containing elements with values obtained by applying corresponding operator to the values in *this.
[编辑] 例外
(无)
[编辑] 注释
每一个运营商只能被实例化,如果满足以下要求:
原文:
Each of the operators can only be instantiated if the following requirements are met:
- 所指示的操作符可以应用键入
T
原文:The indicated operator can be applied to typeT
- 的结果值可以明确转换
T
(1-3)或bool(4).原文:The result value can be unambiguously converted toT
(1-3) or bool (4).
-
该功能可以实现从std::valarray不同的返回类型。在这种情况下,替换类型具有以下属性:
原文:
The function can be implemented with the return type different from std::valarray. In this case, the replacement type has the following properties:
- const提供的所有std::valarray成员函数.原文:All const member functions of std::valarray are provided.
- std::valarray,std::slice_array,std::gslice_array,std::mask_array和std::indirect_array可以由更换型.原文:std::valarray, std::slice_array, std::gslice_array, std::mask_array and std::indirect_array can be constructed from the replacement type.
- 所有的函数接受一个参数的类型const std::valarray&也应接受替换类型.原文:All functions accepting a arguments of type const std::valarray& should also accept the replacement type.
- 接受两个参数的类型const std::valarray&应该接受所有的功能const std::valarray&的每个组合和置换型.原文:All functions accepting two arguments of type const std::valarray& should accept every combination of const std::valarray& and the replacement type.
-