当前位置: 首页 > news >正文

平面设计培训网站大全百度seo新站优化

平面设计培训网站大全,百度seo新站优化,网站查询备案,科技部网站改版方案目录 vector 1. vector的成员函数 1.1 构造、析构和赋值运算符重载 1.1.1 构造函数 1.1.2 析构函数 1.1.3 赋值运算符重载 1.2 迭代器 1.3 容量 1.4 元素访问 1.4.1 遍历方法 1.5 修改器 1.6 配置器 2. vector的非成员函数 vector 1. vector的成员函数 1.1 构造…

目录

vector

1. vector的成员函数

1.1 构造、析构和赋值运算符重载

1.1.1 构造函数

1.1.2 析构函数

1.1.3 赋值运算符重载

1.2 迭代器

1.3 容量

1.4 元素访问

1.4.1 遍历方法

1.5 修改器

1.6 配置器

2. vector的非成员函数


vector

1. vector的成员函数

1.1 构造、析构和赋值运算符重载

1.1.1 构造函数

default

explicit vector(const allocator_type& alloc = allocator_type());默认构造
fillexplicit vector(size_type n, const value_type& val = value_type(), const allocator_type& alloc = allocator_type());用n个val来构造
rangetemplate <class InputIterator>         vector(InputIterator first, InputIterator last, const allocator_type& alloc = allocator_type());用迭代器区间构造

copy

vector(const vector& x);

拷贝构造
#include <iostream>
#include <vector>
#include <string>using namespace std;int main()
{vector<int> v1;//defaultfor (size_t i = 0; i < v1.size(); ++i){cout << v1[i] << " ";}cout << endl;//空vector<int> v2(10, 1);//fillfor (size_t i = 0; i < v2.size(); ++i){cout << v2[i] << " ";}cout << endl;//1 1 1 1 1 1 1 1 1 1string s("hello world");vector<char> v3(s.begin() + 3, --s.end());//rangefor (size_t i = 0; i < v3.size(); ++i){cout << v3[i] << " ";}cout << endl;//l o   w o r lvector<char> v4(v3);//copyfor (size_t i = 0; i < v4.size(); ++i){cout << v4[i] << " ";}cout << endl;//l o   w o r lreturn 0;
}

1.1.2 析构函数

~vector();销毁vector类对象

1.1.3 赋值运算符重载

copyvector& operator= (const vector& x);

1.2 迭代器

begin&end    rbegin&rend    cbegin&cend    crbegin&crend

与string的迭代器类似,详见【C++】string的成员函数、成员常量和非成员函数_秋秋晗晗的博客-CSDN博客中1.2 迭代器

1.3 容量

size    max_size    resize    capacity    empty    reserve    shrink_to_fit

与string的容器类似,详见【C++】string的成员函数、成员常量和非成员函数_秋秋晗晗的博客-CSDN博客中1.3 容器

1.4 元素访问

operator[]    at    front    back    data

与string的元素访问类似,详见【C++】string的成员函数、成员常量和非成员函数_秋秋晗晗的博客-CSDN博客中1.4 元素访问

1.4.1 遍历方法

与string的遍历方法类似,详见【C++】string的成员函数、成员常量和非成员函数_秋秋晗晗的博客-CSDN博客中1.4.1 遍历方法

1.5 修改器

assign    push_back    pop_back    insert    erase    swap    clear    emplace    emplace_back

与string的修改器类似,详见【C++】string的成员函数、成员常量和非成员函数_秋秋晗晗的博客-CSDN博客中1.5 修改器

1.6 配置器

get_allocatorallocator_type get_allocator() const;返回配置器

2. vector的非成员函数

relational operatorstemplate <class T, class Alloc>  bool operator== (const vector<T, Alloc>& lhs, const vector<T, Alloc>& rhs);
template <class T, class Alloc>  bool operator!= (const vector<T, Alloc>& lhs, const vector<T, Alloc>& rhs);
template <class T, class Alloc>  bool operator<  (const vector<T, Alloc>& lhs, const vector<T, Alloc>& rhs);
template <class T, class Alloc>  bool operator<= (const vector<T, Alloc>& lhs, const vector<T, Alloc>& rhs);
template <class T, class Alloc>  bool operator>  (const vector<T, Alloc>& lhs, const vector<T, Alloc>& rhs);
template <class T, class Alloc>  bool operator>= (const vector<T, Alloc>& lhs, const vector<T, Alloc>& rhs);
关系运算符重载
swaptemplate <class T, class Alloc>  void swap(vector<T, Alloc>& x, vector<T, Alloc>& y);交换vector的内容
http://www.hkea.cn/news/912928/

相关文章:

  • 小规模纳税人企业所得税怎么征收广州seo招聘
  • 济南企业自助建站网络营销策划公司
  • iis 新建网站 要登录温州seo推广外包
  • 个人想做企业网站备案惠州seo代理商
  • 做公务员题的网站口红的推广软文
  • 福州网站建设 联系yanktcn 04上海百网优seo优化公司
  • 网站备案号如何获得网站建设营销推广
  • 物流网站开发公司西安 做网站
  • 商务信息网站怎么做网络视频营销策略有哪些
  • 社交做的最好的网站怎么开发一个网站
  • 教育品牌网站建设百度搜索推广和信息流推广
  • 虎门专业做网站对网络营销的认识有哪些
  • 投资理财培训网站建设抖音引流推广一个30元
  • 做景观设施的网站网络营销推广要求
  • 携程网站建设进度及实施过程网络营销的缺点及建议
  • 石家庄网站建设哪家专业中国联通腾讯
  • 能访问各种网站的浏览器百度一下网页搜索
  • 自己做网站花多少钱雅虎搜索
  • 哈尔滨招标信息网网站推广优化排名教程
  • 个人可以建论坛网站吗福清网络营销
  • 济南做网站优化价格百度推广网站一年多少钱
  • 做网上商城网站哪家好杭州seo靠谱
  • 做营销网站制作关键词优化课程
  • 网站移动终端建设口碑营销成功案例
  • 美国做试管婴儿 网站推广普通话宣传语
  • 网站备案信息查询系统软文发布平台媒体
  • 泊头哪给做网站的好制作网页的教程
  • 漳州建设银行网站首页在百度上打广告找谁
  • 网站免费建站k网络营销策划方案书
  • 网站建设类公网店推广的作用