fill用法
来源:互联网 发布:win7apache mysql php 编辑:程序博客网 时间:2024/05/19 03:28
template < class ForwardIterator, class T > void fill ( ForwardIterator first, ForwardIterator last, const T& value );#include<iostream>#include<algorithm>#include<vector>using namespace std;struct info{int key;int value;info(int key,int value):key(key),value(value){}info():key(0),value(0){}bool operator=(info temp){key=temp.key;value=temp.value;}};int main(){vector<info>vec(2);info A(1,2);fill(vec.begin(),vec.end(),A);vector<info>::iterator it;for(it=vec.begin();it!=vec.end();it++)cout<<(*it).key<<"\t"<<(*it).value<<endl;}
<algorithm>
Fill range with value
Sets value to all elements in the range [first,last).
The behavior of this function template is equivalent to:
template < class ForwardIterator, class T > void fill ( ForwardIterator first, ForwardIterator last, const T& value ){ while (first != last) *first++ = value;}
Parameters
- first, last
- Forward iterators to the initial and final positions in a sequence. The range affected is [first,last), which contains all the elements between first and last, including the element pointed by first but not the element pointed by last.
- value
- Value to be used to fill the range.
Return value
none- fill用法
- fill的用法
- Dataadapter.Fill用法
- fill ()
- fill
- Fill
- fill
- C++ fill()和fill_n()函数用法
- Dataframe中na.fill的用法
- C++ fill()和fill_n()函数用法
- arrays.sort用法arrays.fill用法arrays.equals用法
- fill()和fill-n()函数用法及与memset的区别
- STL填充与生成(fill,fill_n,generate,generate_n)的用法
- 【C++】泛型算法里的fill()函数用法
- C++ fill和fill_n函数用法介绍和比较
- 对matlab中colormap的解释及fill、imshow的用法说明
- css3中border-image的用法(fill 、border-image-outset 、border-image-width)
- SqlDataAdapter.Fill
- 【转】cron表达式(quartz中时间表达式)
- ADO.NET 中数据库连接方式
- 学生一族必备热门手机应用软件大汇集
- 从零开始学Android之Activity
- 使用 JavaScript File API 实现文件上传
- fill用法
- 搜索引擎营销:什么是Doorway Page?
- 当退出游戏的时候 游戏虽然退出了 但是进程不会结束掉 所以在退出的时候要加上这句话
- 在一个CommandField中为删除按钮设置OnClientClick属性
- 鼠标拖动div层
- 运动必备苹果配件!打造个人DIY新装扮
- 程序员们 不要想一辈子靠技术混饭吃
- SIP相关的RFC文档全收集
- MSCRM4.0实体所有权组织更改为用户(mscrm update entity ownership)