std::valarray::valarray
valarray(); | (1) | |
---|---|---|
explicit valarray( std::size_t count ); | (2) | |
valarray( const T& val, std::size_t count ); | (3) | |
valarray( const T* vals, std::size_t count ); | (4) | |
valarray( const valarray& other ); | (5) | |
valarray( valarray&& other ); | (6) | (since C++11) |
valarray( const std::slice_array<T>& ); | (7) | |
valarray( const std::gslice_array<T>& ); | (8) | |
valarray( const std::mask_array<T>& ); | (9) | |
valarray( const std::indirect_array<T>& ); | (10) | |
valarray( std::initializer_list<T> il ); | (11) | (since C++11) |
从各种来源构造新的数字数组。
1%29默认构造函数。构造一个空的数字数组。
2%29构造一个数字数组count
值初始化元素的副本。
3%29构造一个数字数组count
副本val
...
4%29构造一个数字数组,其副本为count
指向的数组的值。vals
如果此数组包含的内容少于count
值时,行为是未定义的。
5%29复制构造函数。的内容的副本构造数字数组。other
...
6%29移动构造函数。的内容构造容器。other
使用移动语义。
7-10%29转换构造函数将相应的数据结构转换为valarray
...
11%29使用初始化程序列表的内容构造数字数组。il
...
参数
count | - | the number of elements to construct |
---|---|---|
val | - | the value to initialize the elements with |
vals | - | pointer to a C array to use as source to initialize the contents |
other | - | another numeric array to use as source to initialize the contents |
il | - | initializer list to initialize the elements with |
例外
1-5%29%280%29
6%29
noexcept
规格:
noexcept
7-11%29%280%29
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com