您现在的位置是:主页 > news > wap网站开发流程/优化seo是什么意思
wap网站开发流程/优化seo是什么意思
admin2025/4/22 15:07:24【news】
简介wap网站开发流程,优化seo是什么意思,厦门小羽佳网站建设开发,上海网站建设网页制作你却C 标准库——体系结构和内核分析( 持续更新!!!) 使用一个东西,却不明白它的道理,不高明!—— 林语堂 阶段学习 使用C标准库 认识C标准库(胸中自有丘壑!) 良好使用C标准库…
wap网站开发流程,优化seo是什么意思,厦门小羽佳网站建设开发,上海网站建设网页制作你却C 标准库——体系结构和内核分析( 持续更新!!!) 使用一个东西,却不明白它的道理,不高明!—— 林语堂 阶段学习 使用C标准库 认识C标准库(胸中自有丘壑!) 良好使用C标准库…分配器
C++ 标准库——体系结构和内核分析( 持续更新!!!)
使用一个东西,却不明白它的道理,不高明!—— 林语堂
阶段学习
使用C++标准库
认识C++标准库(胸中自有丘壑!)
良好使用C++标准库
扩充C++标准库
所谓 Generic Programming
(GP
,泛型编程),就是使用 template
(模板)为主要工具来编写程序。
-
GP
是将datas
和methods
分开来;Containers
和Algorithms
可各自闭门造车﹐其间以Iterator
连通即可·Algorithms
通过Iterators
确定操作范围﹐也通过Iterators
取用Container
元素。
-
OOP(Object-Oriented Programming)
,企图将datas
和methods
关联在一起。
C++标准模板库Standard Template
最重要的六大部件(Components
):容器、算法、仿函数、迭代器、适配器、分配器
- 容器(
Containers
)是class template
- 算法(
Algorithms
)是function template
(其内最终涉及元素本身的操作,无非就是比大小!) - 迭代器(
Iterators
)是class template
- 仿函数(
Functors
)是class template
- 适配器(
Adapters
)是class template
- 分配器(
Allocators
)是class template
关系图:
使用例子:
#include <iostream>
#include <vector>
#include <functional>using namespace std;//打开std这个命名空间int main()
{int ia[6] = { 27, 210, 12, 47, 109, 83 };//vector 为容器 ,allocator为分配器,可以不写vector<int, allocator<int>> vi(ia, ia + 6);//connt_if 为算法, vi.begin() 和 vi.end()为迭代器cout << count_if(vi.begin(), vi.end(), not1(bind2nd(less<int>(),40)));//not1 和 bind2nd 为仿函数适配器,less为仿函数return 0;}
容器分类
大致分为两种容器:序列容器,关联容器(key、value)
- 序列容器:
array
、vector
、deque
、list
、forward-list
- 关联容器:
set
、multiset
、map
、multimap
,实现是使用 红黑树(高度平衡二叉树)
C++11
中有Unordered
容器,但他也属于关联容器,实现使用hash table
做的
分配器allocators
- 容器需要一个东西来支持它对内存的使用,这个东西就是分配器,最好的情况下,我们不需要知道这个东西,所以需要一个默认的分配器。
- 比如说
vector
的模版定义如下,会有一个默认的分配器std::allocator<_Tp>
,如果不指定分配器,就会默认使用这一个
template<typename _Tp, typename _Alloc = std::allocator<_Tp>>
class vector : protected _Vector_base<_Tp, _Alloc>
有以下分配器(不在标准库里面):
array_allocator
__mt_allocator //多线程
debug_allocator
__pool_allocator//内存池
bitmap_allocator
malloc_allocator
new_allocator
一般不推荐自己指定分配器,如果自己指定了不好的分配器,会影响容器的性能!
operator new & malloc
C++层面用operator new()
,C 层面用malloc()
allocator
只是以::opreator new
和::opreator delete
完成allocate()
和deallocate()
,没有任何特殊设计;allocate()
会调用malloc()
deallocate()
调用free()
我们需要的size
是青色部分空间的大小,但是malloc
会在青色部分外包裹其他东西。因此,会产生一些额外开销(如果要分配的区块小,那么额外开销就相对较大,不能忍受)。
16条链表,负责不同大小的内存分配。8字节对齐。每个内存块不会都带cookie
。只会在链表的头尾有cookie
。
12
操作符重载:
- 当运算符出现在表达式中,并且其至少一个操作数具有类类型或枚举类型时,重载解析用于确定签名与以下内容匹配的所有函数中要调用的用户定义函数: