STL::forward_list
forward_list(c++11): 内部是一个单链表的实现;但是为了效率的考虑,故意没有 size 这个内置函数。
Constructor
六种构造方式default; fill; range; copy; move; initializer list;
Iterators
before_begin: return iterator to before beginning; 可以作为插入的位置(在第一个元素之前插入,效果类似:push_front)
begin:
end:
cbefore_begin:
cbegin:
cend:
Capacity
empty:
max_size:
Element access
front:
Modifiers
assign:
emplace_front:
emplace_after:
push_front:
pop_front:
insert_after: 没有insert,只有insert_after;可以借助 before_begin 把元素插到第一个位置。返回值是最后一个新插入元素的迭代器。
erase_after: 范围擦除 (position,last),既不包含左值(因为是erase_after,不是erase),也不包含右值。
swap:
resize:
clear:
Operations
splice_after: Transfers elements from fwdlst into the container inserting them after the element pointed by position。
remove: Remove elements with specific value。
remove_if:
unique:
merge:
sort:
reverse:
STL::forward_list的更多相关文章
- STL之序列式容器list与forward_list
List (双向链表) 与 forwardlist (单向链表) 算是非常基础的数据结构了,这里只是简单介绍下其结构及应用. 以list为例: 其节点模板: template <class T& ...
- STL库之单链表:forward_list
class template forward_list <forward_list> template < class T, class Alloc = allocator<T ...
- STL容器-- forward_list 用法
http://www.cplusplus.com/reference/forward_list/
- STL标准库-容器-forward_list
技术在于交流.沟通,本文为博主原创文章转载请注明出处并保持作品的完整性. forward_list即单向list,功能少额外开销就小.而且只能在前段插入元素 结构如下 一 定义 #include &l ...
- [c++] STL = Standard Template Library
How many people give up, because of YOU. Continue... 先实践,最后需要总结. 1. 数据流中的数据按照一定的格式<T>提取 ------ ...
- 1.1 STL 概述
综述 STL = Standard Template Library,标准模板库,惠普实验室开发的一系列软件的统称.它是由Alexander Stepanov.Meng Lee和David R M ...
- C++ STL 迭代器失效问题
之前看<C++ Primier>的时候,也解到在顺序型窗口里insert/erase会涉及到迭代器失效的问题,并没有深究.今天写程序的时候遇到了这个问题. 1 莫名其妙的Erase 最初我 ...
- STL Iterators
Summary of Chapter 33 STL Iterators from The C++ Programming Language 4th. Ed., Bjarne Stroustrup. - ...
- STL概述
一.关于STL STL(Standard Template Library,标准模板库)是C++语言标准中的重要组成部分.STL 以模板类和模板函数的形式为程序员提供了各种数据结构和算法的精巧实现,程 ...
随机推荐
- hive压缩
1. 常用 rcfile + gzip parquet + snappy 2. 压缩比,参考 TextFile默认格式,加载速度最快,可以采用Gzip进行压缩,压缩后的文件无法split,即并行处理 ...
- Jmeter之Bean shell使用-常用内置变量
Bean Shell常用内置变量 JMeter在它的BeanShell中内置了变量,用户可以通过这些变量与JMeter进行交互,其中主要的变量及其使用方法如下: log:写入信息到jmeber.l ...
- djangobb之view form
def add_topic(request, forum_id): """ create a new topic, with or without poll " ...
- python linux 下开发环境搭建
1.1: 在虚拟环境目录下安装 ipython => pip install ipython 1.2: 简单的使用 => ipthyon => print("heollo ...
- 【ASP.NET 进阶】TreeView控件学习
这几天上班没事做,也不好打酱油,学点没接触过的新东西吧,基本了解了下TreeView控件. TreeView 控件用于在树结构中显示分层数据,例如目录或文件目录等. 下面看代码吧: 1.效果图 2.静 ...
- java中线程池的使用
public static ExecutorSevice newSingleThreadExecutor() public static ExecutorSevice newFixedThreadPo ...
- Oracle 学习总结 - 表和索引的性能优化
表的性能 表的性能取决于创建表之前所应用的数据库特性,数据库->表空间->表,创建数据库时确保为每个用户创建一个默认的永久表空间和临时表空间并使用本地管理,创建表空间设为本地管理并且自动段 ...
- CSS COLOR
CSS COLOR Color Review We've completed our extensive tour of the colors in CSS! Let's review the key ...
- codes often WA
枚举: 1.完美立方 #include<iostream> #include <cstdio> using namespace std; int main() { int N; ...
- 火兰hillstone与fortigate之ipsec v.p.n连接实践
文章目录 参考文档: http://ismailaktas.com.tr/hillstone-to-fortigate-ipsec-vpn/ https://wenku.baidu.com/view/ ...