std::array::fill
void fill (const value_type& val);
Sets val as the value for all the elements in the array object.
将val设为array里面所有元素的值。
Parameters
- val
-
Value to fill the array with.
Member type value_type is the type of the elements in the container, defined in array as an alias
of its first template parameter (T).
-
val是用来填满array的值。
Return value
none
Example
|
|
Output:
myarray contains: 5 5 5 5 5 5
|
运行截图:
Complexity
Linear: Performs as many assignment operations as the size of the array object.
和array的size成线性相关。
Iterator validity
No changes.
Data races
All contained elements are modified.
容器所有元素都将被修改。
Exception safety
Basic guarantee: if an exception is thrown, the container is in a valid state.
如果抛出异常,容器依旧保留在有效状态。
It throws if the assignment of any element throws.
如果元素的赋值抛出异常,那么将会抛出异常。
——————————————————————————————————————————————————————————————————
//翻译的不好的地方请多多指导,可以在下面留言或者点击左上方邮件地址给我发邮件,指出我的错误以及不足,以便我修改,更好的分享给大家,谢谢。
转载请注明出处:http://blog.csdn.net/qq844352155
author:天下无双
Email:coderguang@gmail.com
2014-8-30
于GDUT
——————————————————————————————————————————————————————————————————