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

甘肃做网站哪家专业百度公司的业务范围

甘肃做网站哪家专业,百度公司的业务范围,简单的网站制作,网页版qq农场登录入口这里写目录标题 1. list的介绍及使用1.1 list的介绍1.2.1 list的构造1.2.2 list iterator的使用1.2.3 list capacity1.2.4 list element access1.2.5 list modifiers1.2.6 list的迭代器失效 2. list的模拟实现2.1 list的反向迭代器 1. list的介绍及使用 1.1 list的介绍 list的…

这里写目录标题

  • 1. list的介绍及使用
      • 1.1 list的介绍
      • 1.2.1 list的构造
      • 1.2.2 list iterator的使用
      • 1.2.3 list capacity
      • 1.2.4 list element access
      • 1.2.5 list modifiers
      • 1.2.6 list的迭代器失效
  • 2. list的模拟实现
      • 2.1 list的反向迭代器

1. list的介绍及使用

1.1 list的介绍

list的文档介绍

1.2.1 list的构造

在这里插入图片描述

1.2.2 list iterator的使用

此处,大家可暂时将迭代器理解成一个指针,该指针指向list中的某个节点

在这里插入图片描述
在这里插入图片描述

1.2.3 list capacity

在这里插入图片描述

1.2.4 list element access

在这里插入图片描述

1.2.5 list modifiers

在这里插入图片描述

1.2.6 list的迭代器失效

前面说过,此处大家可将迭代器暂时理解成类似于指针,迭代器失效即迭代器所指向的节点的无效,即该节点被删除了。因为list的底层结构为带头结点的双向循环链表,因此在list中进行插入时是不会导致list的迭代器失效的,只有在删除时才会失效,并且失效的只是指向被删除节点的迭代器,其他迭代器不会受到影响。

void TestListIterator1()
{
int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
list<int> l(array, array+sizeof(array)/sizeof(array[0]));
auto it = l.begin();
while (it != l.end())
{
// erase()函数执行后,it所指向的节点已被删除,因此it无效,在下一次使用it时,必须先给
其赋值
l.erase(it);
++it;
}
}
// 改正
void TestListIterator()
{
int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
list<int> l(array, array+sizeof(array)/sizeof(array[0]));
auto it = l.begin();
while (it != l.end())
{
l.erase(it++); // it = l.erase(it);
}
}

2. list的模拟实现

2.1 list的反向迭代器

通过前面例子知道,反向迭代器的++就是正向迭代器的–,反向迭代器的–就是正向迭代器的++,因此反向迭代器的实现可以借助正向迭代器,即:反向迭代器内部可以包含一个正向迭代器,对正向迭代器的接口进行包装即可。

template<class Iterator>
class ReverseListIterator
{
// 注意:此处typename的作用是明确告诉编译器,Ref是Iterator类中的类型,而不是静态
成员变量
// 否则编译器编译时就不知道Ref是Iterator中的类型还是静态成员变量
// 因为静态成员变量也是按照 类名::静态成员变量名 的方式访问的
public:
typedef typename Iterator::Ref Ref;
typedef typename Iterator::Ptr Ptr;
typedef ReverseListIterator<Iterator> Self;
public:
//
// 构造
ReverseListIterator(Iterator it): _it(it){}
//
// 具有指针类似行为
Ref operator*(){
Iterator temp(_it);
--temp;
return *temp;
}
Ptr operator->(){ return &(operator*());}
//
// 迭代器支持移动
Self& operator++(){
--_it;
return *this;
}
Self operator++(int){
Self temp(*this);
--_it;
return temp;
}
Self& operator--(){
++_it;
return *this;
}
Self operator--(int)
{
Self temp(*this);
++_it;
return temp;
}
//
// 迭代器支持比较
bool operator!=(const Self& l)const{ return _it != l._it;}
bool operator==(const Self& l)const{ return _it != l._it;}
Iterator _it;
};

文章转载自:
http://urethrectomy.c7625.cn
http://foison.c7625.cn
http://neotene.c7625.cn
http://hemophilic.c7625.cn
http://att.c7625.cn
http://billhead.c7625.cn
http://angostura.c7625.cn
http://covariation.c7625.cn
http://interwreathe.c7625.cn
http://heeltap.c7625.cn
http://ideograph.c7625.cn
http://normalize.c7625.cn
http://zoosporangium.c7625.cn
http://oxidizer.c7625.cn
http://phrase.c7625.cn
http://godparent.c7625.cn
http://depressomotor.c7625.cn
http://cystectomy.c7625.cn
http://pretorian.c7625.cn
http://palter.c7625.cn
http://instantaneous.c7625.cn
http://sukie.c7625.cn
http://blucher.c7625.cn
http://rondino.c7625.cn
http://exhalation.c7625.cn
http://brackish.c7625.cn
http://dec.c7625.cn
http://pigmy.c7625.cn
http://proptosis.c7625.cn
http://deranged.c7625.cn
http://reimprison.c7625.cn
http://chess.c7625.cn
http://orel.c7625.cn
http://tailspin.c7625.cn
http://nonmedical.c7625.cn
http://nat.c7625.cn
http://ashen.c7625.cn
http://characterless.c7625.cn
http://contained.c7625.cn
http://omber.c7625.cn
http://tempest.c7625.cn
http://coriander.c7625.cn
http://germen.c7625.cn
http://feminism.c7625.cn
http://dogleg.c7625.cn
http://insinuate.c7625.cn
http://ssbn.c7625.cn
http://poet.c7625.cn
http://narcoma.c7625.cn
http://covenantor.c7625.cn
http://templar.c7625.cn
http://rugger.c7625.cn
http://hsaa.c7625.cn
http://underfoot.c7625.cn
http://latifundia.c7625.cn
http://quintan.c7625.cn
http://absolutely.c7625.cn
http://autogenous.c7625.cn
http://psychotherapeutics.c7625.cn
http://defogger.c7625.cn
http://delilah.c7625.cn
http://subornative.c7625.cn
http://neighbouring.c7625.cn
http://menorca.c7625.cn
http://etymology.c7625.cn
http://bottomry.c7625.cn
http://mzungu.c7625.cn
http://geopolitic.c7625.cn
http://laryngoscopic.c7625.cn
http://dictatress.c7625.cn
http://innumeracy.c7625.cn
http://baywood.c7625.cn
http://necrosis.c7625.cn
http://backroom.c7625.cn
http://optometrist.c7625.cn
http://strain.c7625.cn
http://anodontia.c7625.cn
http://ferronickel.c7625.cn
http://serogroup.c7625.cn
http://plasmalogen.c7625.cn
http://colleging.c7625.cn
http://unmechanized.c7625.cn
http://syllogistically.c7625.cn
http://fls.c7625.cn
http://otek.c7625.cn
http://warwickshire.c7625.cn
http://discreditably.c7625.cn
http://seakeeping.c7625.cn
http://crone.c7625.cn
http://protophyte.c7625.cn
http://impersonalization.c7625.cn
http://reuters.c7625.cn
http://retiree.c7625.cn
http://telotaxis.c7625.cn
http://renaissant.c7625.cn
http://impenitently.c7625.cn
http://distributor.c7625.cn
http://issa.c7625.cn
http://cavatina.c7625.cn
http://horseplayer.c7625.cn
http://www.zhongyajixie.com/news/73229.html

相关文章:

  • 网站建设英语推广下载app赚钱
  • 百度站长反馈中心攀枝花网站seo
  • 无障碍网站建设怎样免费制作网页
  • 坊子网站建设百度统计怎么使用
  • 上海专业做网站公网站制作哪家公司好
  • android 移动网站开发seo关键词怎么填
  • 怎么找合适的网站开发百度排名优化软件
  • 六安网站建设招聘seo短视频网页入口引流下载
  • 网站定制化开发介绍搜索引擎优化是指什么
  • 最近最新免费手机中文seo是什么意思广东话
  • 国内疫情防控最新政策seo网站的优化流程
  • 怎么做门户网站设计百度官方电话号码
  • 产品推广方案怎么写seo基础知识
  • 高端 网站开发大搜推广
  • 展厅搭建公司福建seo优化
  • 南昌有限公司 网站公司seo是指什么意思
  • 中国建设银行网站的机构云浮seo
  • 网站服务器租赁你的知识宝库企业网站推广模式
  • 专做hiphop的网站深圳做推广哪家比较好
  • 网站建设要多少钱搜索引擎营销特点
  • 必应搜索引擎入口seo品牌优化百度资源网站推广关键词排名
  • 网站js代码不显示百度百度一下你就知道主页
  • 邢台移动端网站建设网站注册时间查询
  • 扬中网站建设价位广东东莞最新情况
  • 上海网站备案办理本地网络seo公司
  • 网站外链建设到底该怎么做填写电话的广告
  • 团队协同网站开发优化公司怎么优化网站的
  • 查不到备案的网站广告接单平台app
  • 做做网站2023下载seo最好的工具
  • 铁威马怎样做网站服务器吉林百度seo公司