// using 用于指定别名, C++11中using关键字的主要作用是:为一个模板库定义一个别名
// using namespace std; .在当前文件中引入命名空间
//在子类中使用 using 声明引入基类成员名称(参见C++ primer)
C++ 在线文档
https://zh.cppreference.com/w/%E9%A6%96%E9%A1%B5
GCC 编译介绍
https://wenku.baidu.com/view/57dd3d8a856a561253d36f58.html
https://www.cnblogs.com/liangxiaxu/articles/2617367.html
- unordered_map/unordered_multimap
在C++11中有新出4个关联式容器:unordered_map/unordered_set/unordered_multimap/unordered_multiset。
这4个关联式容器与map/multimap/set/multiset功能基本类似,最主要就是底层结构不同,使用场景不容。
如果需要得到一个有序序列,使用红黑树系列的关联式容器,如果需要更高的查询效率,使用以哈希表为底层的关联式容器。
此处只列举unordered_map,其它用法类似可自行查阅 可参考cplusplus
unordered_map底层实现是用哈希桶实现的:
头文件#include<mutex>
template <class Fn, class... Args>
void call_once (once_flag& flag, Fn&& fn, Args&&...args);
第一个参数是std::once_flag的对象(once_flag是不允许修改的,其拷贝构造函数和operator=函数都声明为delete),第二个参数可调用实体,即要求只执行一次的代码,后面可变参数是其参数列表。
std::call_once