摘要: 仿函数(函数对象)和适配器可以说是STL中默默无闻的贡献者,它们没有容器、算法和迭代器那么有名, 但是其贡献却很大。 一、仿函数 仿函数又称函数对象,从名字上可以得出,它本质上是 一种具有函数特质的对象, 也即可以像使用函数一样使用该对象。怎么样做?重载operator()运算符即可,有了这个运算符 阅读全文
posted @ 2017-11-20 22:08 cloudren2020 阅读(210) 评论(0) 推荐(0) 编辑
摘要: /* @note: 学习C++泛型编程 @date: 2017-11-16 @author: cloudren */ #include <iostream> #include <algorithm> #include <string.h> #include <vector> #include <de 阅读全文
posted @ 2017-11-20 21:27 cloudren2020 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 位段 针对类或结构中unsigned或in... 阅读全文
posted @ 2017-11-20 21:08 cloudren2020 阅读(157) 评论(0) 推荐(0) 编辑