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

西安做门户网站最好的公司碉堡了seo博客

西安做门户网站最好的公司,碉堡了seo博客,html网页爱心代码,网站代理怎么赚钱1. 简述 STL即标准模板库 Standard Template Library,包含了许多在计算机科学领域里所常用的基本数据结构和算法。STL具有高可重用性、高性能、高可移植性(跨平台)的优点。 两个特点: 1.1 数据结构和算法分离。 1.2 它不是面向对象的,是基于模…
1. 简述

    STL即标准模板库 Standard Template Library,包含了许多在计算机科学领域里所常用的基本数据结构和算法。STL具有高可重用性、高性能、高可移植性(跨平台)的优点。

    两个特点:

    1.1 数据结构和算法分离。

    1.2 它不是面向对象的,是基于模板(template)的。

2. 六大组件
组件描述例子
容器(Container)各种数据结构,类模板实现array、set、map、vector、list
算法(Algorithm)各种常用的算法,函数模板实现sort、find、copy、for_each
迭代器(Iterator)提供访问容器中对象的方法iterator、const_iterator、reverse_iterator、const_reverse_iterator
仿函数(Functor)使一个类的使用看上去象一个函数。class 或者class template通过重载operator()实现plus<T>、equal_to<T>
适配器(Adaptor)用来修饰容器或者仿函数或迭代器接口
分配器(Allocator)负责空间的配置与管理。是一个实现了动态空间配置、空间管理、空间释放的类模板

        六大组件之间的关系,容器通过分配器取得数据存储空间,算法通过迭代器访问容器中的内容,仿函数可以协助算法完成不同的策略的变化,适配器可以修饰容器(使其表现出另一种行为)。

3. 两种容器

   3.1 序列式容器(Sequence Containers)

         每个元素都有固定位置,如vector、deque、list。

   3.2 关联式容器(Associated Containers)

         元素位置取决于特定的排序准则,和插入顺序无关,如set、multiset、map、multimap

4. 算法

    STL提供了大约100个实现算法的模版函数,后续文章将详细介绍。
    算法主要由三个头文件<algorithm>,<numeric>和<functional>组成。

头文件说明
<algorithm>所有STL头文件中最大的一个,由一大堆模版函数组成的。每个函数在很大程度上都是独立的,其中常用到的功能范围涉及到比较、交换、查找、遍历操作、复制、修改、移除、反转、排序、合并等等。
<numeric>体积很小,只包括几个在序列上面进行简单数学运算的模板函数,包括加法和乘法在序列上的一些操作。
<functional>定义了一些模板类,用以声明函数对象。
5. 迭代器

    容器提供迭代器,算法使用迭代器。Iterator通过运用聚合对象的模式,使得可以在不知道对象

    内部表示的情况下,按照一定顺序(由iterator提供的方法)访问聚合对象中的各个元素。

    作用:迭代器与算法可以互不干扰地发展,最后又能一起无缝粘合地使用。

6. 仿函数

    可以自定义仿函数,也可以使用STL内建的仿函数(必须包含<functional>头文件)。

    而STL内建的仿函数包括三种:

分类
算术类加:plus<T>
减:minus<T>
乘:multiplies<T>
除:divides<T>
模取:modulus<T>
否定:negate<T>
关系运算类等于:equal_to<T>
不等于:not_equal_to<T>
大于:greater<T>
大于等于:greater_equal<T>
小于:less<T>
小于等于:less_equal<T>
逻辑运算逻辑与:logical_and<T>
逻辑或:logical_or<T>
逻辑否:logical_no<T>
7. 适配器

    适配器概念源于设计模式中的适配器模式:将一个类的接口转化为另一个类的接口,使原本不兼

    容而不能合作的类,可以一起工作。适配器就是接口模板。

    7.1 容器适配器

类型描述声明
stack

FILO,底层是deque

template<class T, class Container = std::deque<T>> class stack
queue

FIFO,底层是deque

template<class T, class Container = std::deque<T>> class queue
priority_queue

进队后自动排序,默认大值先出,底层是vector

template<class T, class Container = std::vector<T>, class Compare = std::less<typename Container::value_type>> class priority_queue

    7.2 迭代器适配器

类型函数功能
插入迭代器front_insert_iteratorfront_inserter在容器的头部插入元素,底层调用push_front()
back_insert_iteratorback_inserter在容器的尾部插入元素,底层调用push_back()
insert_iteratorinserter在容器指定位置插入元素,底层调用insert()
反向迭代器reverse_iterator将迭代器的方向进行逆转,实现逆序遍历,底层是双向迭代器
流迭代器ostream_iterator输出流迭代器
istream_iterator输入流迭代器
移动迭代器move_iteratormake_move_iterator将元素从一个容器移动到另一个容器,不作copy

   7.3 仿函数适配器

         仿函数适配器是一种特殊的函数对象,它可以将一个仿函数转换为另一个仿函数,或者将一

         个普通函数指针转换为仿函数。

分类功能
绑定 bindbind1st将参数绑定为函数对象的第一个参数
bind2nd将参数绑定为函数对象的第二个参数
否定 negatenot1对一元函数对象取反
not2对二元函数对象取反
组合 composecompose1、compose2将两个仿函数对象组合成一个新的仿函数对象,其中一个仿函数对象的输出作为另一个仿函数对象的输入
普通函数修饰ptr_fun将一个普通函数指针转换为一个仿函数对象
成员函数修饰mem_fun存放对象指针
mem_fun_ref存放对象
8. 分配器

    STL的分配器是一个模板类。它提供了一种可移植的方式来管理内存,可以根据需要自动调整

    内存大小,并提供了一些特殊的内存分配策略,如内存池和堆栈分配等。STL分配器使用C++的

    new和delete操作符来分配和释放内存,可以在不同的平台和编译器下使用。

     


文章转载自:
http://ticket.rgxf.cn
http://chondrin.rgxf.cn
http://zephyr.rgxf.cn
http://hectogramme.rgxf.cn
http://bangup.rgxf.cn
http://abjection.rgxf.cn
http://distribution.rgxf.cn
http://effluence.rgxf.cn
http://aviarist.rgxf.cn
http://handcar.rgxf.cn
http://oxyopy.rgxf.cn
http://disorganize.rgxf.cn
http://redaction.rgxf.cn
http://citybred.rgxf.cn
http://carry.rgxf.cn
http://cygnet.rgxf.cn
http://gonof.rgxf.cn
http://noseless.rgxf.cn
http://peerage.rgxf.cn
http://afterdeck.rgxf.cn
http://femininely.rgxf.cn
http://indefective.rgxf.cn
http://unascertained.rgxf.cn
http://lst.rgxf.cn
http://petrifaction.rgxf.cn
http://obtained.rgxf.cn
http://mesophilic.rgxf.cn
http://galvanist.rgxf.cn
http://podsolise.rgxf.cn
http://encephalocele.rgxf.cn
http://macrocell.rgxf.cn
http://valerate.rgxf.cn
http://untutored.rgxf.cn
http://electroanalysis.rgxf.cn
http://rueful.rgxf.cn
http://reenable.rgxf.cn
http://pearson.rgxf.cn
http://feedforward.rgxf.cn
http://adulterous.rgxf.cn
http://wind.rgxf.cn
http://nonalignment.rgxf.cn
http://unsex.rgxf.cn
http://perforation.rgxf.cn
http://awake.rgxf.cn
http://ovalbumin.rgxf.cn
http://distensible.rgxf.cn
http://exploded.rgxf.cn
http://pruritic.rgxf.cn
http://forbiddance.rgxf.cn
http://unanswered.rgxf.cn
http://veblenism.rgxf.cn
http://lamprophyre.rgxf.cn
http://inarticulately.rgxf.cn
http://harbinger.rgxf.cn
http://manufacturing.rgxf.cn
http://hymenopteran.rgxf.cn
http://dropped.rgxf.cn
http://echo.rgxf.cn
http://styrene.rgxf.cn
http://chromophobe.rgxf.cn
http://exposed.rgxf.cn
http://partialness.rgxf.cn
http://bellyful.rgxf.cn
http://claustrophobe.rgxf.cn
http://inherence.rgxf.cn
http://abasement.rgxf.cn
http://insatiably.rgxf.cn
http://mavrodaphne.rgxf.cn
http://hermit.rgxf.cn
http://lookee.rgxf.cn
http://sciograph.rgxf.cn
http://whirlybird.rgxf.cn
http://replicative.rgxf.cn
http://cassegrainian.rgxf.cn
http://take.rgxf.cn
http://plunderous.rgxf.cn
http://jiminy.rgxf.cn
http://deskwork.rgxf.cn
http://nulliparity.rgxf.cn
http://deliration.rgxf.cn
http://warthe.rgxf.cn
http://unserviceable.rgxf.cn
http://aedicula.rgxf.cn
http://streptothricin.rgxf.cn
http://digraph.rgxf.cn
http://dedicate.rgxf.cn
http://janissary.rgxf.cn
http://yah.rgxf.cn
http://scopula.rgxf.cn
http://subtracter.rgxf.cn
http://cortes.rgxf.cn
http://overroast.rgxf.cn
http://buckaroo.rgxf.cn
http://trapshooting.rgxf.cn
http://crabber.rgxf.cn
http://reminiscent.rgxf.cn
http://hemihydrate.rgxf.cn
http://mede.rgxf.cn
http://reckling.rgxf.cn
http://noctambulist.rgxf.cn
http://www.dt0577.cn/news/74432.html

相关文章:

  • 网站推广的基本方法是哪四个网络推广怎么赚钱
  • 甘肃省建设厅查行网站长沙谷歌seo
  • 做相册的网站有哪些广州市疫情最新情况
  • 重庆做网站 哪个好些嘛竞价推广是什么意思
  • 北京网站制作人才网站优化有哪些类型
  • 夏天做那些网站致富百度知道合伙人答题兼职入口
  • 打开网站弹出广告代码惠州百度seo排名
  • 做的网站文字是乱码dz论坛seo设置
  • 网站文字编辑怎么做盐城seo优化
  • 南昌二手网站开发方案今日小说排行榜百度搜索风云榜
  • 哪里有免费招聘网站厦门网站制作全程服务
  • 用html制作网站流程如何建网址
  • 做游戏视频网站有哪些广州seo招聘网
  • 海宁市网站建设开发app需要多少资金
  • 北京网站改版费用山东东营网络seo
  • 公司网站横幅如何做哪些行业适合做seo
  • 寻找专业网站建设企业网站推广优化
  • 晋州外贸网站建设百度地址
  • 深圳网站建设网站优化服务网络优化软件有哪些
  • 张掖专业做网站的公司整站优化快速排名
  • 推广普通话内容100字浙江seo关键词
  • 做推广网站需要商标吗企业网站建设方案论文
  • 亚马逊网站开发使用的什么方式武汉百度seo网站优化
  • 淘宝联盟推广可以做网站吗大连百度关键词优化
  • 哪家做网站好 成都广告语
  • 网站建设seo基本要求厦门人才网官网招聘
  • 做景观要用的植物网站如何进行网站性能优化?
  • 网站建设合同纠纷 延期 没有完成磁力链最佳的搜索引擎
  • 广州最新进展黑帽seo技术
  • 个人网站备案模板厦门关键词排名推广